(int)$model->id, 'title' => $model->title, 'slug' => $model->slug, // 'url' => $model->url, // 'url_resource' => $model->url_resource ?? '', 'view_num' => $model->view_num, // 'description' => $model->description, 'published_at' => $model->published_at, // 'course_chapter_id' => $model->course_chapter_id, 'course_chapter' => $model->course_chapter, 'duration' => $model->duration, // 'comment_status' => $model->comment_status, // 'subtitle_zh_path' => $model->subtitle_zh_path, // 'subtitle_zh_path_resource' => $model->subtitle_zh_path_resource ?? '', // 'subtitle_en_path' => $model->subtitle_en_path, // 'subtitle_en_path_resource' => $model->subtitle_en_path_resource ?? '', // 'ban_drag' => $model->ban_drag, 'sort' => $model->sort, 'status' => $model->status, // 'status_test' => ModelStatusEnum::getDescription($model->status), // 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'humans' => $model->created_at->diffForHumans(), ]; } /** * Transform the CourseVideo entity. * * @param \App\Repositories\Models\Course\Video $model * * @return array */ public function detail($model) { return [ 'id' => (int)$model->id, 'title' => $model->title, 'slug' => $model->slug, // 'url' => $model->url, 'url_resource' => $model->url_resource ?? '', 'view_num' => $model->view_num, // 'short_description' => $model->short_description, 'description' => $model->description, // 'published_at' => $model->published_at, // 'course_chapter_id' => $model->course_chapter_id, 'course_chapter' => $model->course_chapter, 'duration' => $model->duration, 'comment_status' => $model->comment_status, // 'subtitle_zh_path' => $model->subtitle_zh_path, 'subtitle_zh_path_resource' => $model->subtitle_zh_path_resource ?? '', // 'subtitle_en_path' => $model->subtitle_en_path, 'subtitle_en_path_resource' => $model->subtitle_en_path_resource ?? '', 'ban_drag' => $model->ban_drag, // 'sort' => $model->sort, 'status' => $model->status, 'status_test' => ModelStatusEnum::getDescription($model->status), // 'created_at' => $model->created_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'updated_at' => $model->updated_at->format(Carbon::DEFAULT_TO_STRING_FORMAT), 'humans' => $model->created_at->diffForHumans(), ]; } }