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

Nevermind. Working as it should - I must have goofed up a test somewhere along the line.

Thought I was going mad!!! My code works!

Last updated 2 years ago.
0

Another way to do this inside routes is using a route::group

Route::group(array('before' => 'auth'), function() 
{
	//ROUTES THAT REQUIRE USER TO BE LOGGED IN
	Route::get('/protected_route', array('as'=>'protected', 'uses'=>'SomeController@someFunc'));
}

The nice thing about this is any route you put in the group will redirect the user to login automatically if they aren't authenticated.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.