Skip to content

Conversation

@winglian
Copy link
Contributor

This will allow multiple middlewares to be packaged together under a single identifier. For example, if I wanted to move Illuminate\Session\Middleware\StartSession and Illuminate\View\Middleware\ShareErrorsFromSession from the global middlewares to the route middlewares, but keep them together so only routes that need sessions would only need to reference a single middleware.

    Route::group(['middleware' => ['session']], function() {
        // ...
    });
    protected $routeMiddleware = [
        'auth' => 'App\Http\Middleware\Authenticate',
        'auth.basic' => 'App\Auth\Middleware\AuthenticateWithBasicAuth',
        'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
        'session' => [
            'Illuminate\Session\Middleware\StartSession',
            'Illuminate\View\Middleware\ShareErrorsFromSession',
        ]
    ];

@GrahamCampbell
Copy link
Collaborator

Send to 5.0 please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants