Hey guys,
what do you think about the following:
Route::get('/', Auth::check() ? 'Controller\Menu@show' : 'Controller\Login@form');
I have never used logic like that in routes.php, but is that considered wrong? I want the main page to display menu or login form, depending on the authorization status. I could provide separate routes for them, but I'd like to keep them both in root. What do you think about it?
What you need is a route filter, see http://laravel.com/docs/security#protecting-routes
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community