I'm trying to use route filters in laravel to check whether a specific user has an access to a page:
Route::filter('check_roles', function()
{
$current_url = URI::current();
$access = 0;
$nav = Session::get('navigation');
foreach($nav as $k => $n){
if(in_array($current_url, $n)){
$access = 1;
}
}
if($access == 0){
return Redirect::to('home');
}
//problem is if the user has access to the page a blank page is returned
});
I'm using it in a route like this:
Route::get('admin/(:all)', array('before' => 'check_roles'));
The problem is if the user has access to the page a blank page is returned. How do I continue on with the default controller action if the user has access?