class PasswordBroker implements PasswordBroker (View source)

Properties

protected TokenRepositoryInterface $tokens

The password token repository.

protected UserProvider $users

The user provider implementation.

protected Dispatcher|null $events

The event dispatcher instance.

protected Timebox $timebox

The timebox instance.

protected int $timeboxDuration

The number of microseconds that the timebox should wait for.

Methods

__construct(TokenRepositoryInterface $tokens, UserProvider $users, Dispatcher|null $dispatcher = null, Timebox|null $timebox = null, int $timeboxDuration = 200000)

Create a new password broker instance.

string
sendResetLink(array $credentials, Closure|null $callback = null)

Send a password reset link to a user.

mixed
reset(array $credentials, Closure $callback)

Reset the password for the given token.

validateReset(array $credentials)

Validate a password reset for the given credentials.

getUser(array $credentials)

Get the user for the given credentials.

string
createToken(CanResetPassword $user)

Create a new password reset token for the given user.

void
deleteToken(CanResetPassword $user)

Delete password reset tokens of the given user.

bool
tokenExists(CanResetPassword $user, string $token)

Validate the given password reset token.

getRepository()

Get the password reset token repository implementation.

getTimebox()

Get the timebox instance used by the guard.

Details

__construct(TokenRepositoryInterface $tokens, UserProvider $users, Dispatcher|null $dispatcher = null, Timebox|null $timebox = null, int $timeboxDuration = 200000)

Create a new password broker instance.

Parameters

TokenRepositoryInterface $tokens
UserProvider $users
Dispatcher|null $dispatcher
Timebox|null $timebox
int $timeboxDuration

Send a password reset link to a user.

Parameters

array $credentials
Closure|null $callback

Return Value

string

mixed reset(array $credentials, Closure $callback)

Reset the password for the given token.

Parameters

array $credentials
Closure $callback

Return Value

mixed

protected CanResetPassword|string validateReset(array $credentials)

Validate a password reset for the given credentials.

Parameters

array $credentials

Return Value

CanResetPassword|string

CanResetPassword|null getUser(array $credentials)

Get the user for the given credentials.

Parameters

array $credentials

Return Value

CanResetPassword|null

Exceptions

UnexpectedValueException

string createToken(CanResetPassword $user)

Create a new password reset token for the given user.

Parameters

CanResetPassword $user

Return Value

string

void deleteToken(CanResetPassword $user)

Delete password reset tokens of the given user.

Parameters

CanResetPassword $user

Return Value

void

bool tokenExists(CanResetPassword $user, string $token)

Validate the given password reset token.

Parameters

CanResetPassword $user
string $token

Return Value

bool

TokenRepositoryInterface getRepository()

Get the password reset token repository implementation.

Timebox getTimebox()

Get the timebox instance used by the guard.

Return Value

Timebox

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.