v2 first commit
This commit is contained in:
32
app/Transformers/Common/Report.php
Normal file
32
app/Transformers/Common/Report.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Transformers\Common;
|
||||
|
||||
use App\Models\Common\Report as Model;
|
||||
use League\Fractal\TransformerAbstract;
|
||||
|
||||
class Report extends TransformerAbstract
|
||||
{
|
||||
/**
|
||||
* @param Model $model
|
||||
* @return array
|
||||
*/
|
||||
public function transform(Model $model)
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'company_id' => $model->company_id,
|
||||
'name' => $model->name,
|
||||
'alias' => $model->alias,
|
||||
'description' => $model->description,
|
||||
'type' => $model->type,
|
||||
'group' => $model->group,
|
||||
'period' => $model->period,
|
||||
'basis' => $model->basis,
|
||||
'graph' => $model->graph,
|
||||
'enabled' => $model->enabled,
|
||||
'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