where('type', StaticPageType::recipes)->firstOrFail(); $recipeModels = Recipe::query()->where('status', true) ->whereHas('range', fn (Builder $q) => $q->where('status', true)) ->orderBy('order') ->get(); return view('fo.pages.recipes.index', compact('staticPageModel', 'recipeModels')); } /** * Recipe show * * @param \App\Models\Recipe $publishedRecipe * @return \Illuminate\Contracts\View\View */ public function show(Recipe $publishedRecipe): \Illuminate\Contracts\View\View { $staticPageModel = StaticPage::query()->where('type', StaticPageType::recipe)->firstOrFail(); return view('fo.pages.recipes.show', [ 'staticPageModel' => $staticPageModel, 'recipeModel' => $publishedRecipe, ]); } }