class DatabaseTokenRepository implements TokenRepositoryInterface

Methods

__construct(ConnectionInterface $connection, Hasher $hasher, string $table, string $hashKey, int $expires = 3600, int $throttle = 60)

Create a new token repository instance.

string
create(CanResetPassword $user)

Create a new token record.

int
deleteExisting(CanResetPassword $user)

Delete all existing reset tokens from the database.

array
getPayload(string $email, string $token)

Build the record payload for the table.

bool
exists(CanResetPassword $user, string $token)

Determine if a token record exists and is valid.

bool
tokenExpired(string $createdAt)

Determine if the token has expired.

bool
recentlyCreatedToken(CanResetPassword $user)

Determine if the given user recently created a password reset token.

bool
tokenRecentlyCreated(string $createdAt)

Determine if the token was recently created.

void
delete(CanResetPassword $user)

Delete a token record by user.

void
deleteExpired()

Delete expired tokens.

string
createNewToken()

Create a new token for the user.

getConnection()

Get the database connection instance.

getTable()

Begin a new database query against the table.

getHasher()

Get the hasher instance.

Details

at line 23
__construct(ConnectionInterface $connection, Hasher $hasher, string $table, string $hashKey, int $expires = 3600, int $throttle = 60)

Create a new token repository instance.

Parameters

ConnectionInterface $connection
Hasher $hasher
string $table
string $hashKey
int $expires

the number of seconds a token should remain valid

int $throttle

minimum number of seconds before the user can generate new password reset tokens

at line 36
string create(CanResetPassword $user)

Create a new token record.

Parameters

CanResetPassword $user

Return Value

string

at line 55
protected int deleteExisting(CanResetPassword $user)

Delete all existing reset tokens from the database.

Parameters

CanResetPassword $user

Return Value

int

at line 63
protected array getPayload(string $email, string $token)

Build the record payload for the table.

Parameters

string $email
string $token

Return Value

array

at line 71
bool exists(CanResetPassword $user, string $token)

Determine if a token record exists and is valid.

Parameters

CanResetPassword $user
string $token

Return Value

bool

at line 86
protected bool tokenExpired(string $createdAt)

Determine if the token has expired.

Parameters

string $createdAt

Return Value

bool

at line 94
bool recentlyCreatedToken(CanResetPassword $user)

Determine if the given user recently created a password reset token.

Parameters

CanResetPassword $user

Return Value

bool

at line 107
protected bool tokenRecentlyCreated(string $createdAt)

Determine if the token was recently created.

Parameters

string $createdAt

Return Value

bool

at line 121
void delete(CanResetPassword $user)

Delete a token record by user.

Parameters

CanResetPassword $user

Return Value

void

at line 129
void deleteExpired()

Delete expired tokens.

Return Value

void

at line 139
string createNewToken()

Create a new token for the user.

Return Value

string

at line 147
ConnectionInterface getConnection()

Get the database connection instance.

Return Value

ConnectionInterface

at line 155
protected Builder getTable()

Begin a new database query against the table.

Return Value

Builder

at line 163
Hasher getHasher()

Get the hasher instance.

Return Value

Hasher