DEV Community

Discussion on: User Authentication using Laravel's passport

Collapse
 
malwarebo profile image
Irfan

I don't know how you have set up the flow but here is something that should probably work.

Inside the BrandController add this to the constructor.

$this->middleware(['auth'']);

Next, the index function inside the controller should look like this:

public function index()
    {
        $brands = Brands::all();
        return view('brands.index');
    }

Then use the Route directly as:

Route:get(/brands, BrandController@index);
Collapse
 
kabircse profile image
Kabir Hossain

Thanks a lot