TopicTransformer.php 713 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Repositories\Transformers\Exam;
  3. use League\Fractal\TransformerAbstract;
  4. use App\Repositories\Models\Exam\Topic;
  5. /**
  6. * Class TopicTransformer.
  7. *
  8. * @package namespace App\Repositories\Transformers\Exam;
  9. */
  10. class TopicTransformer extends TransformerAbstract
  11. {
  12. /**
  13. * Transform the Topic entity.
  14. *
  15. * @param \App\Repositories\Models\Exam\Topic $model
  16. *
  17. * @return array
  18. */
  19. public function transform(Topic $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. }