class RegisterTokenRepository

회원가입시 회원가입 자격을 인증하는 register token의 Repository

Properties

private ConnectionInterface $connection The database connection instance.
private string $table The register-token database table.
private int $expires The number of seconds a token should last.
private Keygen $keygen

Methods

__construct(ConnectionInterface $connection, Keygen $keygen, string $table, int $expires = 60)

Create a new token repository instance.

Fluent
create(string $guard, array $data)

Create a new token record.

Fluent|null
find(string $id)

find token

bool
exists(string $id)

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 $id)

Delete a token record by token.

void
deleteExpired()

Delete expired tokens.

string
createNewToken()

Create a new token id

Builder
getTable()

Begin a new database query against the table.

ConnectionInterface
getConnection()

Get the database connection instance.

Fluent
resolveToken(string $id, string $guard, array $data)

convert token info to token entity

Details

at line 68
__construct(ConnectionInterface $connection, Keygen $keygen, string $table, int $expires = 60)

Create a new token repository instance.

Parameters

ConnectionInterface $connection db connection
Keygen $keygen token id generator
string $table token table name
int $expires duration that token is valid

at line 84
Fluent create(string $guard, array $data)

Create a new token record.

Parameters

string $guard register guard
array $data token data

Return Value

Fluent token entity

at line 107
Fluent|null find(string $id)

find token

Parameters

string $id token id

Return Value

Fluent|null token

at line 125
bool exists(string $id)

Determine if a token record exists and is valid.

Parameters

string $id token id

Return Value

bool

at line 139
private bool tokenExpired(array $token)

Determine if the token has expired.

Parameters

array $token token info

Return Value

bool

at line 151
private int getCurrentTime()

Get the current UNIX timestamp.

Return Value

int

at line 163
void delete(string $id)

Delete a token record by token.

Parameters

string $id token id

Return Value

void

at line 173
void deleteExpired()

Delete expired tokens.

Return Value

void

at line 185
private string createNewToken()

Create a new token id

Return Value

string

at line 195
private Builder getTable()

Begin a new database query against the table.

Return Value

Builder

at line 205
ConnectionInterface getConnection()

Get the database connection instance.

Return Value

ConnectionInterface

at line 219
protected Fluent resolveToken(string $id, string $guard, array $data)

convert token info to token entity

Parameters

string $id token id
string $guard the guard creating token
array $data token data

Return Value

Fluent