protected function sendLoginResponse(Request $request) { $request->session()->regenerate(); $this->clearLoginAttempts($request); if ($response = $this->authenticated($request, $this->guard()->user())) { return $response; } $user = $this->guard()->user(); if($user->is_active) { return $request->wantsJson() ? new JsonResponse([], 204) : redirect()->intended($this->redirectPath()); } else { $request->session()->flush(); return redirect()->route('login')->with('error', 'This account is not activated. Please contact the administrator.'); } }
I put this function inside Auth\LoginController