Support the ongoing development of →
Authentication Security Session
Last updated 9 months ago.

Create a route filter:

In the filter you check if the user is an admin or not.

You can set the filter also in your controller like you did it with csrf and auth.

Last updated 9 months ago.

Thanks for the reply. I managed to do it.

Route::group(array('before' => 'auth'), function(){
	Route::resource('admin/menu', 'admin\MenuController');
Last updated 9 months ago.

just a quick point from your sample code it looks like you are not using the getDashboard method of your user controller.
change your route to use it Route::get('admin/dashboard', '[email protected]') and your original filter in the constructor should then work.

Last updated 9 months ago.

Sign in to participate in this thread!


Your banner here too?

shiva shiva Joined 24 Jul 2014


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

Your logo here?

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

© 2023 - All rights reserved.