src/Providers/AuthServiceProvider.php
protected function overrideMiddleware(Router $router): void
    {
        // Append middleware to the 'web' middlware group
        $router->pushMiddlewareToGroup('web', UpdateLastActivity::class);

        // Override route middleware on the fly
        $router->aliasMiddleware('reauthenticate', Reauthenticate::class);
        $router->aliasMiddleware('guest', RedirectIfAuthenticated::class);
    }
protected function overrideMiddleware(Router $router): void
    {
        // Append middleware to the 'web' middlware group
        $router->pushMiddlewareToGroup('web', UpdateLastActivity::class);

        // Override route middleware on the fly
        $router->aliasMiddleware('reauthenticate', Reauthenticate::class);
        $router->aliasMiddleware('guest', RedirectIfAuthenticated::class);
    }
protected function overrideMiddleware ( Router $ router ) : void { // Append middleware to the 'web' middlware group $ router -> pushMiddlewareToGroup ( 'web' , UpdateLastActivity :: class ) ; // Override route middleware on the fly $ router -> aliasMiddleware ( 'reauthenticate' , Reauthenticate :: class ) ; $ router -> aliasMiddleware ( 'guest' , RedirectIfAuthenticated :: class ) ; }
Override middleware.

@param \Illuminate\Routing\Router $router

@return void
Override middleware .