pageRepo = $pageRepo; } /** * @param \Illuminate\View\View $view */ public function compose(View $view) { try { // If not logged in, then only get the public pages $w = ['enabled' => true]; if (!Auth::check()) { $w = ['public' => true]; } $pages = $this->pageRepo->findWhere($w, ['id', 'name', 'slug', 'icon']); } catch (Exception $e) { $pages = []; } $view->with('page_links', $pages); } }