guest()) { if ($request->ajax()) { return response('Unauthorized.', 401); } return redirect()->guest('login'); } if (intval(auth()->user()->blocked) === 1) { Auth::guard($guard)->logout(); Session::flash('logoutMessage', trans('firefly.block_account_logout')); return redirect()->guest('login'); } return $next($request); } }