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 | $customCasts | from AbstractModel |
|
|
| static | $defaults | from AbstractModel |
|
|
| int|null | $id | 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 |
|
Methods
Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.
Register a callback to be run once after the model is saved.
Register a callback to be run once after the model is deleted.
Generate an email token for the specified user.
Find the token with the given ID, and assert that it has not expired.
Details
in AbstractModel
at
line 67
static
boot()
{@inheritdoc}
in AbstractModel
at
line 87
__construct(array $attributes = [])
{@inheritdoc}
in AbstractModel
at
line 105
getCasts()
{@inheritdoc}
in AbstractModel
at
line 123
mixed
getAttribute(string $key)
Get an attribute from the model. If nothing is found, attempt to load a custom relation method with this key.
in AbstractModel
at
line 149
protected mixed
getCustomRelation(string $name)
Get a custom relation object.
in AbstractModel
at
line 165
void
afterSave(callable $callback)
Register a callback to be run once after the model is saved.
in AbstractModel
at
line 176
void
afterDelete(callable $callback)
Register a callback to be run once after the model is deleted.
in AbstractModel
at
line 184
callable[]
releaseAfterSaveCallbacks()
in AbstractModel
at
line 196
callable[]
releaseAfterDeleteCallbacks()
in AbstractModel
at
line 208
__call($method, $arguments)
{@inheritdoc}
at
line 52
static EmailToken
generate(string $email, int $userId)
Generate an email token for the specified user.
at
line 69
BelongsTo
user()
Define the relationship with the owner of this email token.
at
line 82
EmailToken
scopeValidOrFail(Builder $query, string $id)
Find the token with the given ID, and assert that it has not expired.