1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Transformers/TaxRateTransformer.php

27 lines
665 B
PHP
Raw Normal View History

<?php
namespace App\Transformers;
use App\Models\TaxRate;
use App\Utils\Traits\MakesHash;
/**
* @SWG\Definition(definition="TaxRate", @SWG\Xml(name="TaxRate"))
*/
class TaxRateTransformer extends EntityTransformer
{
use MakesHash;
public function transform(TaxRate $tax_rate)
{
return [
'id' => (string) $this->encodePrimaryKey($tax_rate->id),
'name' => (string) $tax_rate->name,
'rate' => (float) $tax_rate->rate,
'updated_at' => (int)$tax_rate->updated_at,
'archived_at' => (int)$tax_rate->deleted_at,
2020-02-27 00:32:44 +01:00
'created_at' => (int)$tax_rate->created_at,
];
}
}