guest()) { if ($request->ajax()) { return response('Unauthorized.', 401); } else { return redirect()->guest('login'); } } else { 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); } }