Q:

Laravel Filter passes and going to requested URL

I am trying to setup laravel filter in my app.
here is my code,
Filter.php
Route::filter('userid', function($route,$request,$value)
{
 $id = Auth::user()->id;
 $param = $route->getParameter('id');

    $count = DB::table('timesheets')
    ->where('timesheet_id','=',$param)
    ->where('timesheet_user','=',$id)
    ->count();

   if($count == 1)
   {
    return "here going to requested url";
   }
   else
   {
    return "no permission to this page";
   }

});

My Routes,
Route::group(array('before'=>'userid:200'),function($route)
 {
    Route::get('edit-timesheet-{id}',array('as'=>'edit_timesheet_form','uses'=>'TimesheetController@editEntry'));
});

I am getting the parameters and checking with filter.php was fine.
But when a user click on the edit-timesheet-756, if the filter is success, then it needs to continue the execution of the URL, How can i solve this.
Thanks & Regards

A:

in the filter function you should write :
if($count != 1)
 {
  return Redirect::to('another_page');
 }

instead of
 if($count == 1)
 {
   return "here going to requested url";
 }
 else
 {
   return "no permission to this page";
 }

So if the route can pass filter, user will be directed to your edit-timesheet-.. page,  else the user will be redirected to another page like login page or something.

A:

Finally I got the solution. 
just give blank in true condition.
 if($count == 1)
 {
   // here left as blank
 }
 else
 {
  return "no permission to this page";
 }

