middleware("guest"); } public function showForgotPassword() { return view("auth.forgot"); } public function forgotPassword(ForgotPasswordRequest $request) { $user = User::where("email", $request->email)->first(); $user->is_forgot_password = true; $user->is_active = false; $user->security_code = $user->generateSecurityCode(); $user->verify_token = $user->generateVerifyToken(); $user->save(); $user->notify(new ForgotPassword($user)); $request->session()->flash("forgotInfo", "We sent email to you."); return redirect()->route("auth.forgotShow"); } }