本文整理汇总了PHP中Illuminate\Auth\Guard::getProvider方法的典型用法代码示例。如果您正苦于以下问题:PHP Guard::getProvider方法的具体用法?PHP Guard::getProvider怎么用?PHP Guard::getProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Auth\Guard
的用法示例。
在下文中一共展示了Guard::getProvider方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserDetails
public function getUserDetails($username)
{
$creds = call_user_func($this->credentialsFormatter, $username, null);
/** @var \Illuminate\Auth\UserInterface $user */
$user = $this->guard->getProvider()->retrieveByCredentials($creds) ?: false;
if ($user) {
$user = array('scope' => null, 'user_id' => $user->getAuthIdentifier());
}
return $user;
}
示例2: postPassword
/**
* @param Request $request
* @param BcryptHasher $hasher
*
* @return \Illuminate\Http\RedirectResponse
*/
public function postPassword(Request $request, BcryptHasher $hasher)
{
$this->failedValidationRedirect = route('account.password');
$this->validate($request, ['password1' => 'required|min:6', 'password' => 'required']);
if ($this->guard->getProvider()->validateCredentials($this->guard->user(), $request->only('password'))) {
// Don't save the password in plaintext!
ConfirmationManager::send('password', $this->guard->user(), 'account.password.confirm', $hasher->make($request->get('password1')));
return redirect()->route('account.profile')->withSuccess(trans('account.confirm'));
}
return redirect()->route('account.password')->withInput($request->only('password1'))->withErrors(['password1' => trans('member.invalidCredentials')]);
}
示例3: getProvider
/**
* Get the user provider used by the guard.
*
* @return \Illuminate\Contracts\Auth\UserProvider
* @static
*/
public static function getProvider()
{
return \Illuminate\Auth\Guard::getProvider();
}