src/Http/Controllers/DocumentationController.php
public function show($version, $page = null)
    {
        $documentation = $this->documentationRepository->get($version, $page);

        if (Gate::has('viewLarecipe')) {
            $this->authorize('viewLarecipe', $documentation);
        }

        if ($this->documentationRepository->isNotPublishedVersion($version)) {
            return redirect()->route(
                'larecipe.show',
                [
                    'version' => config('larecipe.versions.default'),
                    'page' => config('larecipe.docs.landing')
                ]
            );
        }

        return response()->view('larecipe::docs', [
            'title'          => $documentation->title,
            'index'          => $documentation->index,
            'content'        => $documentation->content,
            'currentVersion' => $version,
            'versions'       => $documentation->publishedVersions,
            'currentSection' => $documentation->currentSection,
            'canonical'      => $documentation->canonical,
        ], $documentation->statusCode);
    }
public function show($version, $page = null)
    {
        $documentation = $this->documentationRepository->get($version, $page);

        if (Gate::has('viewLarecipe')) {
            $this->authorize('viewLarecipe', $documentation);
        }

        if ($this->documentationRepository->isNotPublishedVersion($version)) {
            return redirect()->route(
                'larecipe.show',
                [
                    'version' => config('larecipe.versions.default'),
                    'page' => config('larecipe.docs.landing')
                ]
            );
        }

        return response()->view('larecipe::docs', [
            'title'          => $documentation->title,
            'index'          => $documentation->index,
            'content'        => $documentation->content,
            'currentVersion' => $version,
            'versions'       => $documentation->publishedVersions,
            'currentSection' => $documentation->currentSection,
            'canonical'      => $documentation->canonical,
        ], $documentation->statusCode);
    }
public function show ( $ version , $ page = null ) { $ documentation = $ this -> documentationRepository -> get ( $ version , $ page ) ; if ( Gate :: has ( 'viewLarecipe' ) ) { $ this -> authorize ( 'viewLarecipe' , $ documentation ) ; } if ( $ this -> documentationRepository -> isNotPublishedVersion ( $ version ) ) { return redirect ( ) -> route ( 'larecipe.show' , [ 'version' => config ( 'larecipe.versions.default' ) , 'page' => config ( 'larecipe.docs.landing' ) ] ) ; } return response ( ) -> view ( 'larecipe::docs' , [ 'title' => $ documentation -> title , 'index' => $ documentation -> index , 'content' => $ documentation -> content , 'currentVersion' => $ version , 'versions' => $ documentation -> publishedVersions , 'currentSection' => $ documentation -> currentSection , 'canonical' => $ documentation -> canonical , ] , $ documentation -> statusCode ) ; }
Show a documentation page.

@param $version
@param null $page
@return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Routing\Redirector
@throws \Illuminate\Auth\Access\AuthorizationException
Show a documentation page .