public function action_index($section = null, $page = null) { if (!($content = Docs::content($section, $page))) { return Response::error('404'); } $sidebar = Docs::content('contents'); // For some reason the list is getting br tags. $sidebar = str_replace('<br />', '', $sidebar); // Make the title $title = Docs::title($content) . ' - Laravel Documentation'; // Make it work locally if ($_SERVER['LARAVEL_ENV'] == 'local') { $sidebar = str_replace('/docs', URL::to() . 'docs', $sidebar); } return $this->layout->with('title', $title)->with('sidebar', $sidebar)->with('section', $section)->with('page', $page)->with('content', $content); }