where('star', 1)->get(); $slider = Slider::where('slug', 'home')->first(); $slides = $slider->showable_slides; return view( 'front.home', compact('content', 'products', 'slides') ); } /** * Display a static page * * @param \Illuminate\Http\Request $request * @param \App\Models\StaticPage $content * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory * @throws \RuntimeException If the static page type is not handled. */ public function displayStaticPage(Request $request, StaticPage $content) { switch ($content->type) { case StaticPageType::legals(): return view('front.legal-notice', compact('content')); case StaticPageType::sellconditions(): return view('front.terms', compact('content')); case StaticPageType::contact(): return app(ContactController::class)->contact($request); case StaticPageType::confidentiality(): return view('front.privacy', compact('content')); case StaticPageType::faq(): return view('front.faq', compact('content')); default: throw new \RuntimeException("Unhandled static page {$content->type->label}"); } } }