DatabaseTokenRepository
class DatabaseTokenRepository implements TokenRepositoryInterface
Properties
protected ConnectionInterface | $connection | The database connection instance. |
|
protected Hasher | $hasher | The Hasher implementation. |
|
protected string | $table | The token database table. |
|
protected string | $hashKey | The hashing key. |
|
protected int | $expires | The number of seconds a token should last. |
Methods
Create a new token repository instance.
Build the record payload for the table.
Determine if the token has expired.
Delete expired tokens.
Create a new token for the user.
Get the database connection instance.
Details
at line 58
void
__construct(ConnectionInterface $connection, Hasher $hasher, string $table, string $hashKey, int $expires = 60)
Create a new token repository instance.
at line 74
string
create(CanResetPassword $user)
Create a new token record.
at line 96
protected int
deleteExisting(CanResetPassword $user)
Delete all existing reset tokens from the database.
at line 108
protected array
getPayload(string $email, string $token)
Build the record payload for the table.
at line 120
bool
exists(CanResetPassword $user, string $token)
Determine if a token record exists and is valid.
at line 137
protected bool
tokenExpired(string $createdAt)
Determine if the token has expired.
at line 148
void
delete(CanResetPassword $user)
Delete a token record by user.
at line 158
void
deleteExpired()
Delete expired tokens.
at line 170
string
createNewToken()
Create a new token for the user.
at line 180
ConnectionInterface
getConnection()
Get the database connection instance.
at line 190
protected Builder
getTable()
Begin a new database query against the table.
at line 200
Hasher
getHasher()
Get the hasher instance.