'', 'title' => '', ]; /** * ConsumptionMomentResource * * @return void */ public function __construct(ConsumptionMoment $consumptionMomentModel) { $this->consumptionMomentModel = $consumptionMomentModel; } /** * 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->consumptionMomentModel->getKey(), 'title' => $this->consumptionMomentModel->title, ], $this->getSkeleton() ); } /** * Returns the resource skeletton. */ public static function getSkeleton(): array { return self::$skeleton; } }