app/View/Components/CategoryDropdownWrapper.php
/**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|\Closure|string
     */
Get the view / contents that represent the component.
Get the view / contents that represent the component .
public function render()
    {
        return view('components.category-dropdown-wrapper', [
            'categories' => Category::all(),
            'currentCategory' => Category::firstWhere('slug', request('category')),
        ]);
    }
public function render ( ) { return view ( 'components.category-dropdown-wrapper' , [ 'categories' => Category :: all ( ) , 'currentCategory' => Category :: firstWhere ( 'slug' , request ( 'category' ) ) , ] ) ; }
Get the view / contents that represent the component.
Get the view / contents that represent the component .