Make session available in middleware
4
To make the session context available in a middleware, you have to push the middleware to the Router instead of the Kernel and add it to the web group.
public function boot(): void
{
/** @var \Illuminate\Routing\Router $router */
$router = $this->app->make(\Illuminate\Routing\Router::class);
$router->pushMiddlewareToGroup('web', YourMiddleware::class);
}
There are no comments yet
Be the first one to comment