当前位置: 首页>>代码示例>>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;未经允许,请勿转载。