where('status', '!=', Content::STATUS_DELETED) ->first(); 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'); } // get handler $handler = new $page->module_handler; // render page return $handler->render($page, ''); // return call_user_func([$handler, 'render'], $page); } }