示例#1
0
 /**
  * Send a reset link to the given user.
  *
  * @param  EmailPasswordLinkRequest  $request
  * @return Response
  */
 public function postEmail(Requests\Auth\EmailPasswordLinkRequest $request)
 {
     switch ($response = $this->passwords->sendResetLink($request->only('email'))) {
         case PasswordBroker::RESET_LINK_SENT:
             return redirect()->back()->with('status', 'Ссылка для сброса пароля отправлена на Вашу почту!');
         case PasswordBroker::INVALID_USER:
             return redirect()->back()->withErrors(['email' => 'Такого email не существует!']);
     }
 }
 /**
  * Send a reset link to the given user.
  *
  * @param  EmailPasswordLinkRequest  $request
  * @param  Illuminate\View\Factory $view
  * @return Response
  */
 public function postEmail(EmailPasswordLinkRequest $request, Factory $view)
 {
     $view->composer('emails.auth.password', function ($view) {
         $view->with(['title' => trans('front/password.email-title'), 'intro' => trans('front/password.email-intro'), 'link' => trans('front/password.email-link'), 'expire' => trans('front/password.email-expire'), 'minutes' => trans('front/password.minutes')]);
     });
     switch ($response = $this->passwords->sendResetLink($request->only('email'), function ($message) {
         $message->subject(trans('front/password.reset'));
     })) {
         case PasswordBroker::RESET_LINK_SENT:
             return redirect()->back()->with('status', trans($response));
         case PasswordBroker::INVALID_USER:
             return redirect()->back()->with('error', trans($response));
     }
 }