123456789101112131415161718192021222324252627 |
- <?php
- namespace App\Http\Controllers\QuickApp\User\Transformers;
- use Hashids;
- class UserShelfBooksTransformer
- {
- public function transform($userShelfBook)
- {
- return [
- 'id' => $userShelfBook->id,
- 'uid' => $userShelfBook->uid,
- 'distribution_channel_id' => $userShelfBook->distribution_channel_id,
- //'bid_no_hash' => $userShelfBook->bid,
- 'bid' => Hashids::encode($userShelfBook->bid),
- 'book_name' => $userShelfBook->book_name,
- 'cover' => $userShelfBook->cover,
- 'updated_at' => strtotime($userShelfBook->updated_at),
- 'first_cid' => $userShelfBook->first_cid,
- 'last_cid' => $userShelfBook->last_cid,
- 'last_chapter' => $userShelfBook->last_chapter,
- 'recent_reading_chapter' => $userShelfBook->recent_reading_chapter,
- 'recent_cid'=>$userShelfBook->recent_cid,
- ];
- }
- }
|