|null, * views: int, * updated_at: string, * channel: array{id: string, name: string, type: string, lang: string}, * studio: array{id: string, nickName: string, realName: string, avatar?: string}|null * } */ public function toArray($request): array { return [ 'id' => (string) $this->uid, 'book' => (int) $this->book, 'para' => (int) $this->para, 'progress' => (float) $this->progress, 'progress_line' => is_array($this->progress_line) ? array_values($this->progress_line) : null, 'views' => (int) $this->views, 'updated_at' => $this->updated_at?->toJSON(), 'channel' => [ 'id' => (string) $this->channel_id, 'name' => (string) $this->channel_name, 'type' => (string) $this->channel_type, 'lang' => (string) $this->channel_lang, ], 'studio' => $this->studio, ]; } }