PHP Class Krucas\LaravelUserEmailVerification\DatabaseTokenRepository

Inheritance: implements Krucas\LaravelUserEmailVerification\Contracts\TokenRepositoryInterface
Datei anzeigen Open project: edvinaskrucas/laravel-user-email-verification

Protected Properties

Property Type Description
$connection Illuminate\Database\ConnectionInterface The database connection instance.
$expires integer The number of seconds a token should last.
$hashKey string The hashing key.
$table string The token database table.

Public Methods

Method Description
__construct ( Illuminate\Database\ConnectionInterface $connection, string $table, string $hashKey, integer $expires ) Create a new token repository instance.
create ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user ) : string Create a new token.
createNewToken ( ) : string Create a new token for the user.
delete ( string $token ) : void Delete token record.
deleteExpired ( ) : void Delete expired tokens.
exists ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user, string $token ) : boolean Determine if a token record exists and is valid.
getConnection ( ) : Illuminate\Database\ConnectionInterface Get the database connection instance.

Protected Methods

Method Description
deleteExisting ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user ) : integer Delete all existing reset tokens from the database.
getCurrentTime ( ) : integer Get the current UNIX timestamp.
getPayload ( string $email, string $token ) : array Build the record payload for the table.
getTable ( ) : Builder Begin a new database query against the table.
isExpirationEnabled ( ) : boolean Determine if token expiration is enabled or disabled.
tokenExpired ( array $token ) : boolean Determine if the token has expired.

Method Details

__construct() public method

Create a new token repository instance.
public __construct ( Illuminate\Database\ConnectionInterface $connection, string $table, string $hashKey, integer $expires )
$connection Illuminate\Database\ConnectionInterface
$table string
$hashKey string
$expires integer

create() public method

Create a new token.
public create ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user ) : string
$user Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification
return string

createNewToken() public method

Create a new token for the user.
public createNewToken ( ) : string
return string

delete() public method

Delete token record.
public delete ( string $token ) : void
$token string
return void

deleteExisting() protected method

Delete all existing reset tokens from the database.
protected deleteExisting ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user ) : integer
$user Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification
return integer

deleteExpired() public method

Delete expired tokens.
public deleteExpired ( ) : void
return void

exists() public method

Determine if a token record exists and is valid.
public exists ( Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification $user, string $token ) : boolean
$user Krucas\LaravelUserEmailVerification\Contracts\RequiresEmailVerification
$token string
return boolean

getConnection() public method

Get the database connection instance.
public getConnection ( ) : Illuminate\Database\ConnectionInterface
return Illuminate\Database\ConnectionInterface

getCurrentTime() protected method

Get the current UNIX timestamp.
protected getCurrentTime ( ) : integer
return integer

getPayload() protected method

Build the record payload for the table.
protected getPayload ( string $email, string $token ) : array
$email string
$token string
return array

getTable() protected method

Begin a new database query against the table.
protected getTable ( ) : Builder
return Illuminate\Database\Query\Builder

isExpirationEnabled() protected method

Determine if token expiration is enabled or disabled.
protected isExpirationEnabled ( ) : boolean
return boolean

tokenExpired() protected method

Determine if the token has expired.
protected tokenExpired ( array $token ) : boolean
$token array
return boolean

Property Details

$connection protected_oe property

The database connection instance.
protected ConnectionInterface,Illuminate\Database $connection
return Illuminate\Database\ConnectionInterface

$expires protected_oe property

The number of seconds a token should last.
protected int $expires
return integer

$hashKey protected_oe property

The hashing key.
protected string $hashKey
return string

$table protected_oe property

The token database table.
protected string $table
return string