本文整理汇总了PHP中Credentials::getUserProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP Credentials::getUserProvider方法的具体用法?PHP Credentials::getUserProvider怎么用?PHP Credentials::getUserProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Credentials
的用法示例。
在下文中一共展示了Credentials::getUserProvider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postResend
/**
* Queue the sending of the activation email.
*
* @return \Illuminate\Http\Response
*/
public function postResend()
{
$input = Binput::only('email');
$val = UserRepository::validate($input, array_keys($input));
if ($val->fails()) {
return Redirect::route('account.resend')->withInput()->withErrors($val->errors());
}
$this->throttler->hit();
try {
$user = Credentials::getUserProvider()->findByLogin($input['email']);
if ($user->activated) {
return Redirect::route('account.resend')->withInput()->with('error', 'That user is already activated.');
}
$code = $user->getActivationCode();
$mail = ['url' => URL::to(Config::get('core.home', '/')), 'link' => URL::route('account.activate', ['id' => $user->id, 'code' => $code]), 'email' => $user->getLogin(), 'subject' => Config::get('core.name') . ' - Activation'];
Mail::queue('credentials::emails.resend', $mail, function ($message) use($mail) {
$message->to($mail['email'])->subject($mail['subject']);
});
return Redirect::route('account.resend')->with('success', 'Check your email for your new activation email.');
} catch (UserNotFoundException $e) {
return Redirect::route('account.resend')->with('error', 'That user does not exist.');
}
}