I need to be able to access a number of routes only if a condition is met. Else I should not have access to those routes.
I thought this should be done with a filter but I think I'm missing something about how they work.
So this is my filter:
Route::filter('my.filter', function()
{
//some code regarding said condition
if($mycondition==true){
//WHAT TO PUT HERE?
}else{
//Error message
}
}
And in my routes I will have:
Route::group(array('before' => 'my.filter'), function()
{
Route::resource('cities', 'CitiesController');
//... many more controllers here
});
But all the examples I have seen have a redirect inside the filter in the if part. I don't want that, I only want, if the condition in the filter is true, you get to see that url.