laravel/framework — pull request #4231 by tomzx (2014-04-24 01:14:02+00:00)
Title: Add where constraint support to Route::group()

Hi,

It would be useful if we could call
```php
Route::group(['prefix' => '{var}'], ...)->where('var', '[0-9]+');
```
to constraint the prefix value itself (or possibly any other variable declared in a route within the group) much like it is currently possible to do on the `Route` object.

My current use case is the following:

```php
Route::filter('set-language', function($route, $request) {
$language = $route->parameters('language', 'fr');
App::setLocale($language);
});

Route::group(['prefix' => '{language}', 'before' => 'set-language'], function() {
[...]
})->where('language', '(fr|en)');
```

Thanks!