DatabaseTokenRepository

class DatabaseTokenRepository implements TokenRepositoryInterface (View source)

Properties

protected ConnectionInterface $connection The database connection instance.
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

void __construct(ConnectionInterface $connection, string $table, string $hashKey, int $expires = 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(array $token)

Determine if the token has expired.

int getCurrentTime()

Get the current UNIX timestamp.

void delete(string $token)

Delete a token record by token.

void deleteExpired()

Delete expired tokens.

string createNewToken()

Create a new token for the user.

Builder getTable()

Begin a new database query against the table.

ConnectionInterface getConnection()

Get the database connection instance.

Details

void __construct(ConnectionInterface $connection, string $table, string $hashKey, int $expires = 60)

Create a new token repository instance.

Parameters

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

Return Value

void

string create(CanResetPassword $user)

Create a new token record.

Parameters

CanResetPassword $user

Return Value

string

protected int deleteExisting(CanResetPassword $user)

Delete all existing reset tokens from the database.

Parameters

CanResetPassword $user

Return Value

int

protected array getPayload(string $email, string $token)

Build the record payload for the table.

Parameters

string $email
string $token

Return Value

array

bool exists(CanResetPassword $user, string $token)

Determine if a token record exists and is valid.

Parameters

CanResetPassword $user
string $token

Return Value

bool

protected bool tokenExpired(array $token)

Determine if the token has expired.

Parameters

array $token

Return Value

bool

protected int getCurrentTime()

Get the current UNIX timestamp.

Return Value

int

void delete(string $token)

Delete a token record by token.

Parameters

string $token

Return Value

void

void deleteExpired()

Delete expired tokens.

Return Value

void

string createNewToken()

Create a new token for the user.

Return Value

string

protected Builder getTable()

Begin a new database query against the table.

Return Value

Builder

ConnectionInterface getConnection()

Get the database connection instance.

Return Value

ConnectionInterface

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Auth/Passwords/DatabaseTokenRepository.html