I have this route (note the filter which is being applied with an optional parameter):
Route::get('/greet/{name?}', array(
'before' => 'summergreet:optionalNameToCapture',
function ($name = 'friend') {
return View::make('greetview', array('name' => $name));
}
));
And the assigned filter:
Route::filter('summergreet', function($route, $request, $name = 'amigo')
{
if (date('m') >= 7 && date('m') <= 9) {
return View::make('summergreetview', array('name' => $name));
}
});
How can I capture the optional parameter to the route and pass it through to the filter?