content = $content; } public function getPage($url) { $page = $this->content->getByURL($url); // no page available if (!$page) { abort(404); } return $this->renderPage($page); } /** * Method used for rendering page for visitor * * @param Content $page * * @return mixed * @throws \Exception */ protected function renderPage(Content $page) { // test if loaded page is visible or not if ($page->status == Content::STATUS_PROTECTED && !Auth::user()) { throw new \Exception('Cannot access protected resources'); } // decode module settings $page->module_settings = json_decode($page->module_settings); // get handler $handler = new $page->module_handler; // render page return $handler->render($page, ''); } }