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