當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CanResetPassword::getEmailForPasswordReset方法代碼示例

本文整理匯總了PHP中Illuminate\Contracts\Auth\CanResetPassword::getEmailForPasswordReset方法的典型用法代碼示例。如果您正苦於以下問題:PHP CanResetPassword::getEmailForPasswordReset方法的具體用法?PHP CanResetPassword::getEmailForPasswordReset怎麽用?PHP CanResetPassword::getEmailForPasswordReset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Contracts\Auth\CanResetPassword的用法示例。


在下文中一共展示了CanResetPassword::getEmailForPasswordReset方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendNewPassword

 public function sendNewPassword(CanResetPassword $user)
 {
     $password = str_random(8);
     $user->password = $password;
     $user->save();
     $this->mailer->send('auth::emails.new_password', compact('user', 'password'), function ($m) use($user) {
         $m->to($user->getEmailForPasswordReset());
     });
 }
開發者ID:laravolt,項目名稱:auth,代碼行數:9,代碼來源:Password.php

示例2: requestChangePassword

 /**
  * Generate a token for password change and saves it in
  * the Reminder table with the email of the
  * user.
  *
  * @param CanResetPasswordContract $account An existent user.
  *
  * @return string Password reset token.
  */
 public function requestChangePassword(CanResetPasswordContract $account)
 {
     $token = $this->generateToken();
     $values = ['email' => $account->getEmailForPasswordReset(), 'token' => $token, 'created_at' => new \DateTime()];
     $reminder = $this->getReminder()->fill($values);
     $reminder->save();
     $this->sendEmail($account, $token);
     return $token;
 }
開發者ID:master0mind,項目名稱:Lavender,代碼行數:18,代碼來源:Password.php

示例3: emailResetLink

 /**
  * Send the password reset link via e-mail.
  * Overrides to use the mail queue.
  *
  * @override
  * @see PasswordBroker::emailResetLink()
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @param  \Closure|null  $callback
  * @return int
  */
 public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $view = $this->emailView;
     return $this->mailer->queue($view, compact('token', 'user'), function ($m) use($user, $token, $callback) {
         $m->to($user->getEmailForPasswordReset());
         if (!is_null($callback)) {
             call_user_func($callback, $m, $user, $token);
         }
     });
 }
開發者ID:causelabs,項目名稱:laravel52-boilerplate,代碼行數:25,代碼來源:CustomPasswordBroker.php

示例4: exists

 /**
  * Determine if a token record exists and is valid.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @return bool
  */
 public function exists(CanResetPasswordContract $user, $token)
 {
     $email = $user->getEmailForPasswordReset();
     $token = (array) $this->getTable()->where('email', $email)->where('token', $token)->first();
     return $token && !$this->tokenExpired($token);
 }
開發者ID:nsoimaru,項目名稱:Laravel51-starter,代碼行數:13,代碼來源:DatabaseTokenRepository.php

示例5: exists

 /**
  * Determine if a reminder record exists and is valid.
  *
  * @param \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param string                                      $token
  *
  * @return bool
  */
 public function exists(CanResetPassword $user, $token)
 {
     $email = $user->getEmailForPasswordReset();
     $reminder = $this->makeSelect()->where('o.email = :email')->andWhere('o.token = :token')->setParameter('email', $email)->setParameter('token', $token)->getQuery()->getOneOrNullResult();
     return $reminder != null && !$this->reminderExpired($reminder);
 }
開發者ID:spohess,項目名稱:orm,代碼行數:14,代碼來源:DoctrineTokenRepository.php

示例6: createEmailResetLink

 /**
  * Send the password reset link via e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $token
  * @param  \stdClass $viewData
  * @param  \Closure|null $callback
  *
  * @return int
  */
 private function createEmailResetLink(CanResetPasswordContract $user, $token, \stdClass $viewData, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $email = $viewData;
     $email->token = $token;
     $this->mailer->send($this->emailView, compact('email'), function ($m) use($user, $token, $callback) {
         /**
          * @var \Illuminate\Mail\Message $m
          */
         $m->to($user->getEmailForPasswordReset());
         if (!is_null($callback)) {
             call_user_func($callback, $m, $user, $token);
         }
     });
 }
開發者ID:linguisticteam,項目名稱:laravel-boilerplate,代碼行數:27,代碼來源:PasswordBroker.php

示例7: createNewToken

 /**
  * Create a new token for the user.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @return string
  */
 public function createNewToken(CanResetPasswordContract $user)
 {
     $email = $user->getEmailForPasswordReset();
     $value = str_shuffle(sha1($email . spl_object_hash($this) . microtime(true)));
     return hash_hmac('sha1', $value, $this->hashKey);
 }
開發者ID:visualturk,項目名稱:framework,代碼行數:12,代碼來源:DatabaseTokenRepository.php

示例8: emailResetLink

 /**
  * Send the password reset link via e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword $user
  * @param  string $token
  * @param  \Closure|null $callback
  * @return int
  */
 public function emailResetLink(CanResetPasswordContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $view = $this->emailView;
     try {
         $this->mailer->send($view, compact('token', 'user'), function ($message) use($user, $token, $callback) {
             $message->from($user->getEmailForPasswordReset());
             $message->to($user->getEmailForPasswordReset());
             if (!is_null($callback)) {
                 call_user_func($callback, $message, $user, $token);
             }
         });
         return Redirect('/')->with('mensaje', 'Se ha enviado el link de cambio de contraseña a tu correo electrónico.');
     } catch (\Exception $ex) {
         switch ($ex->getCode()) {
             case 550:
                 break;
             default:
                 return Redirect('/')->with('mensaje', 'El servidor de correos no ha realizado el envío del link del cambio de contraseña.');
         }
     }
 }
開發者ID:antoniobec,項目名稱:palencia,代碼行數:32,代碼來源:PasswordBroker.php


注:本文中的Illuminate\Contracts\Auth\CanResetPassword::getEmailForPasswordReset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。