Create a route filter: http://laravel.com/docs/routing#route-filters
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.
Thanks for the reply. I managed to do it.
Route::group(array('before' => 'auth'), function(){
Route::resource('admin/menu', 'admin\MenuController');
});
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', 'UserController@getDashboard')
and your original filter in the constructor should then work.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community