public function getPage($slug = 'home')
    {
        $view = parent::getPage($slug);
        $page = Page::findOrFail((int)$view->page->id);

        $view->layout = $page->layout;
        $view = BladeCompiler::getHtmlFromString($view, [], true);

        return $view;
    }
public function getPage($slug = 'home')
    {
        $view = parent::getPage($slug);
        $page = Page::findOrFail((int)$view->page->id);

        $view->layout = $page->layout;
        $view = BladeCompiler::getHtmlFromString($view, [], true);

        return $view;
    }
public function getPage ( $ slug = 'home' ) { $ view = parent :: getPage ( $ slug ) ; $ page = Page :: findOrFail ( ( int ) $ view -> page -> id ) ; $ view -> layout = $ page -> layout ; $ view = BladeCompiler :: getHtmlFromString ( $ view , [ ] , true ) ; return $ view ; }
Add the layout to the returned page

@param string $slug

@return string
Add the layout to the returned page