mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 15:13:29 +01:00
24 lines
810 B
PHP
24 lines
810 B
PHP
|
<?php namespace App\Ninja\Transformers;
|
||
|
|
||
|
use App\Models\Account;
|
||
|
use App\Models\Credit;
|
||
|
use League\Fractal;
|
||
|
|
||
|
class CreditTransformer extends EntityTransformer
|
||
|
{
|
||
|
public function transform(Credit $credit)
|
||
|
{
|
||
|
return [
|
||
|
'id' => (int) $credit->public_id,
|
||
|
'amount' => (float) $credit->amount,
|
||
|
'balance' => (float) $credit->balance,
|
||
|
'updated_at' => $this->getTimestamp($credit->updated_at),
|
||
|
'archived_at' => $this->getTimestamp($credit->deleted_at),
|
||
|
'is_deleted' => (bool) $credit->is_deleted,
|
||
|
'account_key' => $this->account->account_key,
|
||
|
'credit_date' => $credit->credit_date,
|
||
|
'credit_number' => $credit->credit_number,
|
||
|
'private_notes' => $credit->private_notes,
|
||
|
];
|
||
|
}
|
||
|
}
|