laravel/framework — pull request #5957 by lucasmichot (2014-10-03 12:23:01+00:00)
Title: [4.2] Route : introduce skipped filters

The Idea of this feature came after a discussion on https://github.com/dingo/api/issues/146.

Group filters are very useful as routes can inherit their filters, but sometimes there can be a need to skip some inherited before/after filters for a specific route.
This can be now be achieved in *skipping* a filter with a minus sign : `-filtername`

```php
Route::group(['before' => 'b1|b2', 'after' => 'a1|a2'], function () {
Route::group(['before' => 'b3|b4', 'after' => 'a3|a4'], function () {
Route::get('foo', [
'as' => 'foo',
'uses' => 'MyController@foo',
]);
Route::get('bar', [
'as' => 'bar',
'uses' => 'MyController@bar',
'before' => 'b5|b6|-b1|-b4',
'after' => ['a5', 'a6', '-a1', '-a4'],
]);
});
});
```

In this examples:

Route `foo` :
* before filters b1, b2, b3, b4, b5 and b6 will be applied
* after filters a1, a2, a3, a4, a5 and a6 will be applied.

Route `bar` :
* before filters b1 and b4 are skipped; before filters b2, b3, b5 and b6 will be applied
* before filters a1 and a4 are skipped; before filters a2, a3, a5 and a6 will be applied