123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace App\Repositories\Transformers;
- use League\Fractal\TransformerAbstract;
- use App\Repositories\Models\Base\Resource;
- /**
- * Class ResourceTransformer.
- *
- * @package namespace App\Repositories\Transformers;
- */
- class ResourceTransformer extends TransformerAbstract
- {
- /**
- * Transform the Resource entity.
- *
- * @param \App\Repositories\Models\Resource $model
- *
- * @return array
- */
- public function transform(Resource $model)
- {
- return [
- 'id' => (int)$model->id,
- /* place your other model properties here */
- 'created_at' => $model->created_at,
- 'updated_at' => $model->updated_at
- ];
- }
- }
|