PasswordBroker
in package
implements
PasswordBroker
Interfaces, Classes and Traits
Table of Contents
- $passwordValidator : Closure
- The custom password validator callback.
- $tokens : TokenRepositoryInterface
- The password token repository.
- $users : UserProvider
- The user provider implementation.
- __construct() : void
- Create a new password broker instance.
- createToken() : string
- Create a new password reset token for the given user.
- deleteToken() : void
- Delete password reset tokens of the given user.
- getRepository() : TokenRepositoryInterface
- Get the password reset token repository implementation.
- getUser() : CanResetPassword|null
- Get the user for the given credentials.
- reset() : mixed
- Reset the password for the given token.
- sendResetLink() : string
- Send a password reset link to a user.
- tokenExists() : bool
- Validate the given password reset token.
- validateNewPassword() : bool
- Determine if the passwords match for the request.
- validator() : void
- Set a custom password validator.
- validatePasswordWithDefaults() : bool
- Determine if the passwords are valid for the request.
- validateReset() : CanResetPassword|string
- Validate a password reset for the given credentials.
Properties
$passwordValidator
The custom password validator callback.
protected
Closure
$passwordValidator
$tokens
The password token repository.
protected
TokenRepositoryInterface
$tokens
$users
The user provider implementation.
protected
UserProvider
$users
Methods
__construct()
Create a new password broker instance.
public
__construct(TokenRepositoryInterface $tokens, UserProvider $users) : void
Parameters
- $tokens : TokenRepositoryInterface
- $users : UserProvider
Return values
void —createToken()
Create a new password reset token for the given user.
public
createToken(CanResetPassword $user) : string
Parameters
- $user : CanResetPassword
Return values
string —deleteToken()
Delete password reset tokens of the given user.
public
deleteToken(CanResetPassword $user) : void
Parameters
- $user : CanResetPassword
Return values
void —getRepository()
Get the password reset token repository implementation.
public
getRepository() : TokenRepositoryInterface
Return values
TokenRepositoryInterface —getUser()
Get the user for the given credentials.
public
getUser(array<string|int, mixed> $credentials) : CanResetPassword|null
Parameters
- $credentials : array<string|int, mixed>
Tags
Return values
CanResetPassword|null —reset()
Reset the password for the given token.
public
reset(array<string|int, mixed> $credentials, Closure $callback) : mixed
Parameters
- $credentials : array<string|int, mixed>
- $callback : Closure
Return values
mixed —sendResetLink()
Send a password reset link to a user.
public
sendResetLink(array<string|int, mixed> $credentials) : string
Parameters
- $credentials : array<string|int, mixed>
Return values
string —tokenExists()
Validate the given password reset token.
public
tokenExists(CanResetPassword $user, string $token) : bool
Parameters
- $user : CanResetPassword
- $token : string
Return values
bool —validateNewPassword()
Determine if the passwords match for the request.
public
validateNewPassword(array<string|int, mixed> $credentials) : bool
Parameters
- $credentials : array<string|int, mixed>
Return values
bool —validator()
Set a custom password validator.
public
validator(Closure $callback) : void
Parameters
- $callback : Closure
Return values
void —validatePasswordWithDefaults()
Determine if the passwords are valid for the request.
protected
validatePasswordWithDefaults(array<string|int, mixed> $credentials) : bool
Parameters
- $credentials : array<string|int, mixed>
Return values
bool —validateReset()
Validate a password reset for the given credentials.
protected
validateReset(array<string|int, mixed> $credentials) : CanResetPassword|string
Parameters
- $credentials : array<string|int, mixed>