just create a new filter in app/filters.php
Route::filter('isAdmin', function() {
if(Auth::user()->role != 'admin') {
return Redirect::to('/');
}
});
and use it like
Route::group(['before' => 'auth|isAdmin'], function() ...
Superb, thanks - I've just figured that out by playing around :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community