'', 'title' => '', 'video_id' => '', ]; /** * VideoResource * * @return void */ public function __construct(Video $videoModel) { $this->videoModel = $videoModel; } /** * Transform the resource into an array. * * @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass */ public function toArray(?Request $request = null): array { // phpcs:enable return array_intersect_key( [ 'id' => $this->videoModel->getKey(), 'title' => $this->videoModel->title, 'video_id' => $this->videoModel->video_id, ], $this->getSkeleton() ); } /** * Returns the resource skeletton. */ public static function getSkeleton(): array { return self::$skeleton; } }