ChapterTransformer.php 894 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Http\Controllers\QuickApp\Book\Transformers;
  3. use Hashids;
  4. class ChapterTransformer
  5. {
  6. public function transform($chapter){
  7. return [
  8. 'bid' => Hashids::encode($chapter->bid),
  9. //'bid_no_hash' => $chapter->bid,
  10. 'chapter_id' => $chapter->id,
  11. 'chapter_name' => $chapter->name,
  12. 'chapter_sequence' => $chapter->sequence,
  13. 'chapter_is_vip' => $chapter->is_vip,
  14. 'chapter_size' => $chapter->size,
  15. 'prev_cid' => $chapter->prev_cid,
  16. 'next_cid' => $chapter->next_cid,
  17. 'recent_update_at' => $chapter->recent_update_at,
  18. 'chapter_content' => $chapter->content,
  19. 'sign_status' => $chapter->sign_status,
  20. //'is_need_subscirbe' => $chapter->is_need_subscirbe,
  21. ];
  22. }
  23. }