Support the ongoing development of Laravel.io →
posted 9 years ago
Security
Last updated 1 year ago.
0
Solution

Without seeing your code, you can something like.

Route::group(array('before' => 'auth'), function() { Route::get('/', array('as' => 'home', 'uses' => 'HomeController@getIndex')); });

Last updated 1 year ago.
0

'before' => 'auth' in the snippet @frocco provided is setting a before filter. This will run before the method the route goes to is made. By setting it to auth, it will make sure the user is authenticated and if not redirect them to /login. This can be changed in app/filters.php.

Read about filters here

Last updated 1 year ago.
0

Thanks for the replies.

It worked for me.I added all the necessary routes inside the group filter.

             Route::group(array('before' => 'auth'), function() { Routes goes here.... });

Thank you.....

Last updated 1 year ago.
0

Sign in to participate in this thread!

Full Stack Europe

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.

© 2023 Laravel.io - All rights reserved.