当前位置: 首页>>代码示例>>PHP>>正文


PHP Reminder::exists方法代码示例

本文整理汇总了PHP中Reminder::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::exists方法的具体用法?PHP Reminder::exists怎么用?PHP Reminder::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reminder的用法示例。


在下文中一共展示了Reminder::exists方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remind

 /**
  * Handle posting of the form for the forgot password.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function remind()
 {
     $email = Input::get('email');
     if ($user = Sentinel::findByCredentials(compact('email'))) {
         $reminder = Reminder::exists($user) ?: Reminder::create($user);
         $code = $reminder->code;
         $sent = Mail::send('sentinel.emails.reminder', compact('user', 'code'), function ($m) use($user) {
             $m->to($user->email)->subject('Reset your account password.');
         });
     }
     return Redirect::route('user.remember')->withSuccess('An email was sent with instructions on how to reset your password.');
 }
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:17,代码来源:RemindersController.php

示例2: postForgot

 public function postForgot(Request $request)
 {
     $input = $request->all();
     $credentials = ['email' => $request->email];
     $rules = ['password' => 'required|email|exists:users,email'];
     $validator = Validator::make($input, $rules);
     if ($validator->fails()) {
         return back()->withInput()->withErrors($validator);
     }
     if ($user = Sentinel::findByCredentials($credentials)) {
         $reminder = Reminder::exists($user) ?: Reminder::create($user);
         $code = $reminder->code;
         $sent = Mail::send('sentinel.emails.reminder', compact('user', 'code'), function ($m) use($user) {
             $m->to($user->email)->subject('Reset your account password.');
         });
         return redirect()->route('wait');
     } else {
         return back()->withInput()->with('fail', trans('validation.no_user_that_email'));
     }
 }
开发者ID:majid-n,项目名称:laravel,代码行数:20,代码来源:AuthController.php

示例3: InitForgotPassword

 /**
  * Begin the password reset process
  *
  * @param AccountForgotPassword $request
  *
  * @return $this
  */
 public function InitForgotPassword(AccountForgotPassword $request)
 {
     try {
         $credentials = ['email' => \Input::get('email')];
         $user = \Sentinel::getUserRepository()->findByCredentials($credentials);
         \Reminder::create($user);
         $reminder = \Reminder::exists($user);
         \Mail::queue('emails.account.resetpassword', ['username' => \Input::get('email'), 'user_id' => $user->getUserId(), 'reset_code' => $reminder['code'], 'reset_link' => env('URL') . '/auth/forgotpassword/set?' . http_build_query(array('ResetCode' => $reminder['code'], 'UserId' => $user->getUserId()))], function ($message) {
             $message->from('no-reply@modestmusic.ml', 'Modest Music | Account Services');
             $message->to(\Input::get('email'));
         });
         return redirect('auth/login')->withErrors(array('login' => 'We have sent you your reset link. Please check your Spam Email.'));
     } catch (\Exception $e) {
         return redirect('auth/forgotpassword')->withErrors(array('password_reset' => 'User Not found in our database!'));
     }
 }
开发者ID:brucewu16899,项目名称:Core,代码行数:23,代码来源:AuthController.php


注:本文中的Reminder::exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。