DatabaseTokenRepository
class DatabaseTokenRepository implements TokenRepositoryInterface
Methods
Create a new token repository instance.
Build the record payload for the table.
Determine if the token has expired.
Determine if the given user recently created a password reset token.
Determine if the token was recently created.
Delete expired tokens.
Create a new token for the user.
Get the database connection instance.
Details
at line 27
__construct(ConnectionInterface|ConnectionResolverInterface $connection, Hasher $hasher, string $table, string $hashKey, int $expires = 3600, int $throttle = 60, string|null $connectionName = null)
Create a new token repository instance.
Cached repositories should receive a resolver because a concrete pooled connection is returned to its pool when the owning coroutine ends.
at line 42
string
create(CanResetPassword $user)
Create a new token record.
at line 61
protected int
deleteExisting(CanResetPassword $user)
Delete all existing reset tokens from the database.
at line 69
protected array
getPayload(string $email, string $token)
Build the record payload for the table.
at line 77
bool
exists(CanResetPassword $user, string $token)
Determine if a token record exists and is valid.
at line 92
protected bool
tokenExpired(string $createdAt)
Determine if the token has expired.
at line 100
bool
recentlyCreatedToken(CanResetPassword $user)
Determine if the given user recently created a password reset token.
at line 113
protected bool
tokenRecentlyCreated(string $createdAt)
Determine if the token was recently created.
at line 127
void
delete(CanResetPassword $user)
Delete a token record by user.
at line 135
void
deleteExpired()
Delete expired tokens.
at line 145
string
createNewToken()
Create a new token for the user.
at line 153
ConnectionInterface
getConnection()
Get the database connection instance.
at line 165
protected Builder
getTable()
Begin a new database query against the table.
at line 173
Hasher
getHasher()
Get the hasher instance.