validated()); $builder = FeaturedTheme::query() ->whereNotNull(FeaturedTheme::ATTRIBUTE_START_AT) ->whereDate(FeaturedTheme::ATTRIBUTE_START_AT, ComparisonOperator::LTE->value, Date::now()); $featuredthemes = $action->index($builder, $query, $request->schema()); return new FeaturedThemeCollection($featuredthemes, $query); } /** * @param StoreAction $action */ public function store(StoreRequest $request, StoreAction $action): FeaturedThemeJsonResource { $featuredtheme = $action->store(FeaturedTheme::query(), $request->validated()); return new FeaturedThemeJsonResource($featuredtheme, new Query()); } public function show(ShowRequest $request, FeaturedTheme $featuredtheme, ShowAction $action): FeaturedThemeJsonResource { $query = new Query($request->validated()); $show = $action->show($featuredtheme, $query, $request->schema()); return new FeaturedThemeJsonResource($show, $query); } public function update(UpdateRequest $request, FeaturedTheme $featuredtheme, UpdateAction $action): FeaturedThemeJsonResource { $updated = $action->update($featuredtheme, $request->validated()); return new FeaturedThemeJsonResource($updated, new Query()); } public function destroy(FeaturedTheme $featuredtheme, DestroyAction $action): JsonResponse { $message = $action->forceDelete($featuredtheme); return new JsonResponse([ 'message' => $message, ]); } }