You can access route parameters within your filter via first closure's parameter ($route).
In your case this code would probably do what you want:
Route::any('/{id}', array(
'before' => 'auth|ownWed', // we don't pass $id here
'as' => 'wedding',
'uses' => 'WeddingController@main'
))->where('id', '[0-9]+');
Route::filter('ownWed', function($route) {
// the $route variable passed to this closure contains
// current route object which has all the info you want
echo 'id parameter in route = ' . $route->getParameter('id');
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community