Support the ongoing development of Laravel.io →
Authentication
Last updated 2 years ago.
0

Hi Wired00,

Did you manage to solve this problem?

J

0

I have just run into the same problem.

This simple route throws the errors mentioned above.

Route::get('/', ['middleware' => 'auth', function()
{
    return view('home');
}]);

Instead of scratching my head and trying to debug laravel logic, I just changed it to use a controller.

Route::get('/', ['middleware' => 'auth',
                 'uses' => 'HomeController@index']);

At that point I might as well throw the auth call into the HomeController constructor....

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

wired00 wired00 Joined 25 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.