2017-10-11 19:52:35 +03:00
|
|
|
<?php
|
|
|
|
|
2020-12-24 01:28:38 +03:00
|
|
|
namespace App\Transformers\Document;
|
2017-10-11 19:52:35 +03:00
|
|
|
|
2020-12-24 01:28:38 +03:00
|
|
|
use App\Models\Document\DocumentTotal as Model;
|
2017-10-11 19:52:35 +03:00
|
|
|
use League\Fractal\TransformerAbstract;
|
|
|
|
|
2021-01-02 12:21:16 +03:00
|
|
|
class DocumentTotal extends TransformerAbstract
|
2017-10-11 19:52:35 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Model $model
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform(Model $model)
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => $model->id,
|
|
|
|
'company_id' => $model->company_id,
|
2020-12-24 01:28:38 +03:00
|
|
|
'type' => $model->type,
|
|
|
|
'document_id' => $model->document_id,
|
2017-10-11 19:52:35 +03:00
|
|
|
'code' => $model->code,
|
|
|
|
'name' => $model->name,
|
|
|
|
'amount' => $model->amount,
|
|
|
|
'sort_order' => $model->sort_order,
|
2019-11-16 10:21:14 +03:00
|
|
|
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
|
|
|
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
2017-10-11 19:52:35 +03:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|