예제 #1
0
 public function postReset(ResetRequest $request)
 {
     try {
         app(UserResetter::class)->startReset($request->all());
     } catch (UserNotFoundException $e) {
         flash()->error(trans('user::messages.no user found'));
         return redirect()->back()->withInput();
     }
     flash()->success(trans('user::messages.check email to reset password'));
     return redirect()->route('reset');
 }
예제 #2
0
 /**
  * Send a reset link to the given user.
  *
  * @param ResetRequest $request
  * @return \Illuminate\Http\Response
  */
 public function postEmail(ResetRequest $request)
 {
     $response = Password::sendResetLink($request->only('email'), function (Message $message) {
         $message->subject($this->getEmailSubject());
     });
     switch ($response) {
         case Password::RESET_LINK_SENT:
             return redirect()->back()->with('status', trans($response));
         case Password::INVALID_USER:
             return redirect()->back()->withErrors(['email' => trans($response)]);
     }
 }