where('type', StaticPageType::rules)->firstOrFail(); return $this->viewStaticPage($staticPageModel); } /** * Show the privacy view * * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory */ public function charte() { $staticPageModel = StaticPage::query()->where('type', StaticPageType::confidentiality)->firstOrFail(); return $this->viewStaticPage($staticPageModel); } /** * Show the legals view * * @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory */ public function legals() { $staticPageModel = StaticPage::query()->where('type', StaticPageType::legals)->firstOrFail(); return $this->viewStaticPage($staticPageModel); } /** * Display a static page * * @param \App\Models\StaticPage $staticPageModel * @return \Illuminate\Contracts\View\View */ private function viewStaticPage(StaticPage $staticPageModel): View { return view('theme::pages.static_page', [ 'staticPageModel' => $staticPageModel ]); } }