'Главная', 'link' => '/', ], ]; protected $authRoutes = [ [ 'title' => 'Каталог', 'link' => '/catalog', ] ]; protected $manageRoutes = [ [ 'title' => 'Управление курсами', 'link' => '/manage/course', ] ]; /** * Create a new component instance. */ public function __construct() { // if (Auth::check()) { $this->routes = array_merge($this->routes, $this->authRoutes); }; if (Gate::allows('course-create')) { $this->routes = array_merge($this->routes, $this->manageRoutes); }; } /** * Get the view / contents that represent the component. */ public function render(): View|Closure|string { return view('components.header.navbar', ['routes' => $this->routes]); } }