added item taxes and totals to document api
This commit is contained in:
28
app/Transformers/Document/DocumentHistory.php
Normal file
28
app/Transformers/Document/DocumentHistory.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Transformers\Document;
|
||||
|
||||
use App\Models\Document\DocumentHistory as Model;
|
||||
use League\Fractal\TransformerAbstract;
|
||||
|
||||
class DocumentHistory extends TransformerAbstract
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Model $model)
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'company_id' => $model->company_id,
|
||||
'type' => $model->type,
|
||||
'document_id' => $model->document_id,
|
||||
'status' => $model->status,
|
||||
'notify' => $model->notify,
|
||||
'description' => $model->description,
|
||||
'created_at' => $model->created_at ? $model->created_at->toIso8601String() : '',
|
||||
'updated_at' => $model->updated_at ? $model->updated_at->toIso8601String() : '',
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user