broker()->reset( $this->credentials($request), function ($user, $password) { $this->resetPassword($user, $password); } ); // If the password was successfully reset, we will redirect the user back to // the application's home authenticated view. If there is an error we can // redirect them back to where they came from with their error message. if ($response === Password::PASSWORD_RESET) { return $this->sendResetResponse(); } throw new DisplayException(trans($response)); } /** * Send a successful password reset response back to the callee. * * @return \Illuminate\Http\JsonResponse */ protected function sendResetResponse(): JsonResponse { return response()->json([ 'success' => true, 'redirect_to' => $this->redirectTo, ]); } }