RegionTransformer.php 647 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Transformers;
  3. use League\Fractal\TransformerAbstract;
  4. use App\Models\Region;
  5. /**
  6. * Class RegionTransformer.
  7. *
  8. * @package namespace App\Transformers;
  9. */
  10. class RegionTransformer extends TransformerAbstract
  11. {
  12. /**
  13. * Transform the Region entity.
  14. *
  15. * @param \App\Models\Region $model
  16. *
  17. * @return array
  18. */
  19. public function transform(Region $model)
  20. {
  21. return [
  22. 'id' => (int) $model->id,
  23. /* place your other model properties here */
  24. 'created_at' => $model->created_at,
  25. 'updated_at' => $model->updated_at
  26. ];
  27. }
  28. }