/** * Show a documentation page. * * @param $version * @param null $page * * @return \Illuminate\Http\Response */ public function show($version, $page = null) { if (!$this->isVersion($version)) { return redirect('docs/' . $this->docs->defaultVersion() . '/' . $version, 301); } if (!$this->docs->sectionExists($version, $page ?: 'installation')) { abort(404); } $section = '/' . $page; $doc = $this->docs->get($version, $page ?: 'installation'); return view('docs', ['title' => $doc['title'], 'index' => $this->docs->getIndex($version), 'content' => $doc['content'], 'currentVersion' => $version, 'versionTitle' => $this->versionTitle($version), 'versions' => $this->getEnabledVersions(), 'currentSection' => $section]); }