content = $content; } public function getPage($url) { $contentModel = $this->content; $page = Cache::remember('content-' . $url, setting('contentCacheLifetime', 5), function () use ($contentModel, $url) { return $contentModel->getByURL($url); }); // no page available if (!$page) { abort(404); } return $this->renderPage($page); } /** * Method used for rendering page for visitor * * @param ContentModel $page * * @return mixed * @throws \Exception */ protected function renderPage(ContentModel $page) { // test if loaded page is visible or not if ($page->isProtected() && !Auth::user()) { abort(404); } // add one new "view" for page $page->view(); return PageRenderer::render($page); } }