checkLoginAllowed->execute((int) $userId)) { Auth::guard('web')->logout(); $request->session()->invalidate(); $request->session()->regenerateToken(); // The reason goes in the URL: Livewire follows this redirect with // fetch first, which would consume a flashed message. return redirect()->route('login', ['access' => 'ended']); } return $next($request); } }