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

It seems like you want to protect some route from being accessed by non logged users. The best way to do that is so use route groupes :

Route::group([ 'before' => 'auth' ], function(){

  // Your routes for logged-in user here

});

Route::group([ 'before' => 'guest' ], function(){

  // Your routes for guest user here

});
Last updated 2 years ago.
0

Thank you for the reply. I'm aware of the that method, I just don't understand why this: http://laravel.com/docs/controllers#controller-filters , doesn't work for me.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

voloszad voloszad Joined 3 Jul 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.