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


PHP Password::sendResetLink方法代碼示例

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


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

示例1: store

 /**
  * Store a newly created resource in storage.
  *
  * @param \Illuminate\Http\Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $user = $this->updateOrCreate($request);
     \Password::sendResetLink(['email' => $user->email], function (Message $message) {
         $message->subject('Velkommen til ub-baser');
     });
     return redirect()->action('Admin\\UserController@index')->with('status', 'En epost er sendt til brukeren med instruksjoner for å sette passord.');
 }
開發者ID:scriptotek,項目名稱:ub-baser,代碼行數:15,代碼來源:UserController.php

示例2: postEmail

 public function postEmail(Request $request)
 {
     $this->validate($request, ['email' => 'required|exists:users,email,active,1']);
     $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)]);
     }
 }
開發者ID:jonschwa,項目名稱:camp-schwartzelrod,代碼行數:13,代碼來源:PasswordController.php

示例3: postRemind

 /**
  * Handle a POST request to remind a user of their password.
  *
  * @return Response
  */
 public function postRemind()
 {
     \App::make('route');
     \Config::set('auth.defaults.passwords', 'panel');
     $response = \Password::sendResetLink(Input::only('email'), function ($message) {
         $message->subject('Password Reminder');
     });
     switch ($response) {
         case PasswordBrokerContract::INVALID_USER:
             return \Redirect::back()->with('message', \Lang::get($response))->with('mesType', 'error');
         case PasswordBrokerContract::RESET_LINK_SENT:
             return \Redirect::back()->with('message', \Lang::get($response))->with('mesType', 'info');
     }
 }
開發者ID:dhaval48,項目名稱:panel,代碼行數:19,代碼來源:RemindersController.php

示例4: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $credentials = ['email' => $this->argument('email')];
     $user = User::firstOrNew($credentials);
     if (!$user->isDirty()) {
         $this->info('User already exists');
         return;
     }
     $user->name = $this->argument('name');
     $user->rights = $this->option('admin') ? ['admin'] : [];
     $user->save();
     \Password::sendResetLink($credentials, function (Message $message) {
         $message->subject('Velkommen til ub-baser');
     });
     $this->info('User created, email sent to ' . $user->email . '.');
 }
開發者ID:scriptotek,項目名稱:ub-baser,代碼行數:21,代碼來源:CreateUserCommand.php

示例5: password_request

 public function password_request()
 {
     $credentials = array('email' => Input::get('email'));
     $response = Password::sendResetLink($credentials, function ($message) {
         $message->subject('Password Reset Info');
     });
     switch ($response) {
         case PasswordBroker::RESET_LINK_SENT:
             return Redirect::to('login')->with(array('note' => trans($response), 'note_type' => 'success'));
         case PasswordBroker::INVALID_USER:
             return redirect()->back()->with(array('note' => trans($response), 'note_type' => 'error'));
     }
 }
開發者ID:rinodung,項目名稱:hello-video-laravel,代碼行數:13,代碼來源:ThemeAuthController.php

示例6: sendReminder

 /**
  * Send reminder email.
  *
  * @return Response
  */
 public function sendReminder()
 {
     $result = Password::sendResetLink(Input::only('email'), function ($message, $user) {
         $message->subject(trans('login.reminder_subject'));
     });
     switch ($result) {
         case Password::INVALID_USER:
             return Redirect::back()->with('error', trans('login.wrong_creds'));
         case Password::RESET_LINK_SENT:
             return Redirect::back()->with('status', trans('login.reminder_sent'));
     }
 }
開發者ID:alex-petkevich,項目名稱:proweb5,代碼行數:17,代碼來源:LoginController.php


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