class EmailToken extends AbstractModel

Properties

bool $timestamps Indicates if the model should be timestamped. Turn off by default. from AbstractModel
protected callable[] $afterSaveCallbacks An array of callbacks to be run once after the model is saved. from AbstractModel
protected callable[] $afterDeleteCallbacks An array of callbacks to be run once after the model is deleted. from AbstractModel
static $customRelations from AbstractModel
static $dateAttributes from AbstractModel
static $defaults from AbstractModel
protected array $dates The attributes that should be mutated to dates.
bool $incrementing Use a custom primary key for this model.
protected $primaryKey {@inheritdoc}
string $token
int $user_id
Carbon $created_at
string $email

Methods

static 
boot()

{@inheritdoc}

__construct(array $attributes = [])

{@inheritdoc}

array
getDates()

Get the attributes that should be converted to dates.

mixed
getAttribute(string $key)

Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.

mixed
getCustomRelation(string $name)

Get a custom relation object.

void
afterSave(callable $callback)

Register a callback to be run once after the model is saved.

void
afterDelete(callable $callback)

Register a callback to be run once after the model is deleted.

callable[]
releaseAfterSaveCallbacks()

No description

callable[]
releaseAfterDeleteCallbacks()

No description

__call($method, $arguments)

{@inheritdoc}

static EmailToken
generate(string $email, int $userId)

Generate an email token for the specified user.

BelongsTo
user()

Define the relationship with the owner of this email token.

scopeValidOrFail(Builder $query, string $id)

Find the token with the given ID, and assert that it has not expired.

Details

static boot()

{@inheritdoc}

__construct(array $attributes = [])

{@inheritdoc}

Parameters

array $attributes

array getDates()

Get the attributes that should be converted to dates.

Return Value

array

mixed getAttribute(string $key)

Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.

Parameters

string $key

Return Value

mixed

protected mixed getCustomRelation(string $name)

Get a custom relation object.

Parameters

string $name

Return Value

mixed

void afterSave(callable $callback)

Register a callback to be run once after the model is saved.

Parameters

callable $callback

Return Value

void

void afterDelete(callable $callback)

Register a callback to be run once after the model is deleted.

Parameters

callable $callback

Return Value

void

callable[] releaseAfterSaveCallbacks()

Return Value

callable[]

callable[] releaseAfterDeleteCallbacks()

Return Value

callable[]

__call($method, $arguments)

{@inheritdoc}

Parameters

$method
$arguments

static EmailToken generate(string $email, int $userId)

Generate an email token for the specified user.

Parameters

string $email
int $userId

Return Value

EmailToken

BelongsTo user()

Define the relationship with the owner of this email token.

Return Value

BelongsTo

EmailToken scopeValidOrFail(Builder $query, string $id)

Find the token with the given ID, and assert that it has not expired.

Parameters

Builder $query
string $id

Return Value

EmailToken

Exceptions

InvalidConfirmationTokenException