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