Skip to content

Instantly share code, notes, and snippets.

@descubraomundo
Created June 28, 2014 14:35
Show Gist options
  • Save descubraomundo/37a30f4f7f711c9d0939 to your computer and use it in GitHub Desktop.
Save descubraomundo/37a30f4f7f711c9d0939 to your computer and use it in GitHub Desktop.
Laravel 4 auth role based page access
Route::filter('role', function()
{
if(Auth::user()->role != 'admin') {
return Redirect::to('home');
}
});
Route::get('protectedPage1', array('before'=>'role', function() {
// do your job
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment