addHours(48), function () use ($path) { return Page::where('path', '=', $path) ->with('section.pages.section', 'section.mainSection') ->first(); }); if ($page === null) { abort(404); } $subSectionPages = $page->section ? PageResource::collection($page->section->pages) : null; $seo = $this->seoPageProvider->getSeoForModel($page); $page = new PageResource($page); if ($page->code != 200) { abort($page->code); } return inertia()->render('Page', [ 'page' => $page, 'subSectionPages' => $subSectionPages, 'seo' => $seo, ]); } }