class DatabaseNotification extends Model

Traits

Constants

CREATED_AT

The name of the "created at" column.

UPDATED_AT

The name of the "updated at" column.

Properties

protected array $attributes

The model's attributes.

from  HasAttributes
protected array $original

The model attribute's original state.

from  HasAttributes
protected array $casts

The attributes that should be cast to native types.

protected array $dates

The attributes that should be mutated to dates.

from  HasAttributes
protected string $dateFormat

The storage format of the model's date columns.

from  HasAttributes
protected array $appends

The accessors to append to the model's array form.

from  HasAttributes
static bool $snakeAttributes

Indicates whether attributes are snake cased on arrays.

from  HasAttributes
static protected array $mutatorCache

The cache of the mutated attributes for each class.

from  HasAttributes
protected array $events

The event map for the model.

from  HasEvents
protected array $observables

User exposed observable events.

from  HasEvents
protected array $relations

The loaded relationships for the model.

from  HasRelationships
protected array $touches

The relationships that should be touched on save.

from  HasRelationships
static array $manyMethods

The many to many relationship methods.

from  HasRelationships
bool $timestamps

Indicates if the model should be timestamped.

from  HasTimestamps
protected array $hidden

The attributes that should be hidden for serialization.

from  HidesAttributes
protected array $visible

The attributes that should be visible in serialization.

from  HidesAttributes
protected array $fillable

The attributes that are mass assignable.

from  GuardsAttributes
protected array $guarded

The guarded attributes on the model.

static protected bool $unguarded

Indicates if all mass assignment is enabled.

from  GuardsAttributes
protected string $connection

The connection name for the model.

from  Model
protected string $table

The table associated with the model.

protected string $primaryKey

The primary key for the model.

from  Model
protected string $keyType

The "type" of the auto-incrementing ID.

from  Model
bool $incrementing

Indicates if the IDs are auto-incrementing.

protected array $with

The relations to eager load on every query.

from  Model
protected array $withCount

The relationship counts that should be eager loaded on every query.

from  Model
protected int $perPage

The number of models to return for pagination.

from  Model
bool $exists

Indicates if the model exists.

from  Model
bool $wasRecentlyCreated

Indicates if the model was inserted during the current request lifecycle.

from  Model
static protected ConnectionResolverInterface $resolver

The connection resolver instance.

from  Model
static protected Dispatcher $dispatcher

The event dispatcher instance.

from  Model
static protected array $booted

The array of booted models.

from  Model
static protected array $globalScopes

The array of global scopes on the model.

from  Model

Methods

array
attributesToArray()

Convert the model's attributes to an array.

array
addDateAttributesToArray(array $attributes)

Add the date attributes to the attributes array.

array
addMutatedAttributesToArray(array $attributes, array $mutatedAttributes)

Add the mutated attributes to the attributes array.

array
addCastAttributesToArray(array $attributes, array $mutatedAttributes)

Add the casted attributes to the attributes array.

array
getArrayableAttributes()

Get an attribute array of all arrayable attributes.

array
getArrayableAppends()

Get all of the appendable values that are arrayable.

array
relationsToArray()

Get the model's relationships in array form.

array
getArrayableRelations()

Get an attribute array of all arrayable relations.

array
getArrayableItems(array $values)

Get an attribute array of all arrayable values.

mixed
getAttribute(string $key)

Get an attribute from the model.

mixed
getAttributeValue(string $key)

Get a plain attribute (not a relationship).

mixed
getAttributeFromArray(string $key)

Get an attribute from the $attributes array.

mixed
getRelationValue(string $key)

Get a relationship.

mixed
getRelationshipFromMethod(string $method)

Get a relationship value from a method.

bool
hasGetMutator(string $key)

Determine if a get mutator exists for an attribute.

mixed
mutateAttribute(string $key, mixed $value)

Get the value of an attribute using its mutator.

mixed
mutateAttributeForArray(string $key, mixed $value)

Get the value of an attribute using its mutator for array conversion.

mixed
castAttribute(string $key, mixed $value)

Cast an attribute to a native PHP type.

string
getCastType(string $key)

Get the type of cast for a model attribute.

$this
setAttribute(string $key, mixed $value)

Set a given attribute on the model.

bool
hasSetMutator(string $key)

Determine if a set mutator exists for an attribute.

bool
isDateAttribute(string $key)

Determine if the given attribute is a date or date castable.

$this
fillJsonAttribute(string $key, mixed $value)

Set a given JSON attribute on the model.

$this
getArrayAttributeWithValue(string $path, string $key, mixed $value)

Get an array attribute with the given key and value set.

array
getArrayAttributeByKey(string $key)

Get an array attribute or return an empty array if it is not set.

string
castAttributeAsJson(string $key, mixed $value)

Cast the given attribute to JSON.

string
asJson(mixed $value)

Encode the given value as JSON.

mixed
fromJson(string $value, bool $asObject = false)

Decode the given JSON back into an array or object.

Carbon
asDate(mixed $value)

Return a timestamp as DateTime object with time set to 00:00:00.

Carbon
asDateTime(mixed $value)

Return a timestamp as DateTime object.

bool
isStandardDateFormat(string $value)

Determine if the given value is a standard date format.

string
fromDateTime(DateTime|int $value)

Convert a DateTime to a storable string.

int
asTimestamp(mixed $value)

Return a timestamp as unix timestamp.

string
serializeDate(DateTimeInterface $date)

Prepare a date for array / JSON serialization.

array
getDates()

Get the attributes that should be converted to dates.

string
getDateFormat()

Get the format for database stored dates.

$this
setDateFormat(string $format)

Set the date format used by the model.

bool
hasCast(string $key, array|string|null $types = null)

Determine whether an attribute should be cast to a native type.

array
getCasts()

Get the casts array.

bool
isDateCastable(string $key)

Determine whether a value is Date / DateTime castable for inbound manipulation.

bool
isJsonCastable(string $key)

Determine whether a value is JSON castable for inbound manipulation.

array
getAttributes()

Get all of the current attributes on the model.

$this
setRawAttributes(array $attributes, bool $sync = false)

Set the array of model attributes. No checking is done.

mixed|array
getOriginal(string|null $key = null, mixed $default = null)

Get the model's original attribute values.

$this
syncOriginal()

Sync the original attributes with the current.

$this
syncOriginalAttribute(string $attribute)

Sync a single original attribute with its current value.

bool
isDirty(array|string|null $attributes = null)

Determine if the model or given attribute(s) have been modified.

bool
isClean(array|string|null $attributes = null)

Determine if the model or given attribute(s) have remained the same.

array
getDirty()

Get the attributes that have been changed since last sync.

bool
originalIsNumericallyEquivalent(string $key)

Determine if the new and old values for a given key are numerically equivalent.

$this
append(array|string $attributes)

Append attributes to query when building a query.

$this
setAppends(array $appends)

Set the accessors to append to model arrays.

array
getMutatedAttributes()

Get the mutated attributes for a given instance.

static void
cacheMutatedAttributes(string $class)

Extract and cache all the mutated attributes of a class.

static array
getMutatorMethods(mixed $class)

Get all of the attribute mutator methods.

static void
observe(object|string $class)

Register an observer with the Model.

array
getObservableEvents()

Get the observable event names.

$this
setObservableEvents(array $observables)

Set the observable event names.

void
addObservableEvents(array|mixed $observables)

Add an observable event name.

void
removeObservableEvents(array|mixed $observables)

Remove an observable event name.

static void
registerModelEvent(string $event, Closure|string $callback)

Register a model event with the dispatcher.

mixed
fireModelEvent(string $event, bool $halt = true)

Fire the given event for the model.

mixed|null
fireCustomModelEvent(string $event, string $method)

Fire a custom model event for the given event.

mixed
filterModelEventResults(mixed $result)

Filter the model event results.

static void
saving(Closure|string $callback)

Register a saving model event with the dispatcher.

static void
saved(Closure|string $callback)

Register a saved model event with the dispatcher.

static void
updating(Closure|string $callback)

Register an updating model event with the dispatcher.

static void
updated(Closure|string $callback)

Register an updated model event with the dispatcher.

static void
creating(Closure|string $callback)

Register a creating model event with the dispatcher.

static void
created(Closure|string $callback)

Register a created model event with the dispatcher.

static void
deleting(Closure|string $callback)

Register a deleting model event with the dispatcher.

static void
deleted(Closure|string $callback)

Register a deleted model event with the dispatcher.

static void
flushEventListeners()

Remove all of the event listeners for the model.

static Dispatcher
getEventDispatcher()

Get the event dispatcher instance.

static void
setEventDispatcher(Dispatcher $dispatcher)

Set the event dispatcher instance.

static void
unsetEventDispatcher()

Unset the event dispatcher for models.

static mixed
addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null)

Register a new global scope on the model.

static bool
hasGlobalScope(Scope|string $scope)

Determine if a model has a global scope.

static Scope|Closure|null
getGlobalScope(Scope|string $scope)

Get a global scope registered with the model.

array
getGlobalScopes()

Get the global scopes for this class instance.

hasOne(string $related, string $foreignKey = null, string $localKey = null)

Define a one-to-one relationship.

morphOne(string $related, string $name, string $type = null, string $id = null, string $localKey = null)

Define a polymorphic one-to-one relationship.

belongsTo(string $related, string $foreignKey = null, string $ownerKey = null, string $relation = null)

Define an inverse one-to-one or many relationship.

morphTo(string $name = null, string $type = null, string $id = null)

Define a polymorphic, inverse one-to-one or many relationship.

morphEagerTo(string $name, string $type, string $id)

Define a polymorphic, inverse one-to-one or many relationship.

morphInstanceTo(string $target, string $name, string $type, string $id)

Define a polymorphic, inverse one-to-one or many relationship.

static string
getActualClassNameForMorph(string $class)

Retrieve the actual class name for a given morph class.

string
guessBelongsToRelation()

Guess the "belongs to" relationship name.

hasMany(string $related, string $foreignKey = null, string $localKey = null)

Define a one-to-many relationship.

hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null)

Define a has-many-through relationship.

morphMany(string $related, string $name, string $type = null, string $id = null, string $localKey = null)

Define a polymorphic one-to-many relationship.

belongsToMany(string $related, string $table = null, string $foreignKey = null, string $relatedKey = null, string $relation = null)

Define a many-to-many relationship.

morphToMany(string $related, string $name, string $table = null, string $foreignKey = null, string $relatedKey = null, bool $inverse = false)

Define a polymorphic many-to-many relationship.

morphedByMany(string $related, string $name, string $table = null, string $foreignKey = null, string $relatedKey = null)

Define a polymorphic, inverse many-to-many relationship.

string
guessBelongsToManyRelation()

Get the relationship name of the belongs to many.

string
joiningTable(string $related)

Get the joining table name for a many-to-many relation.

bool
touches(string $relation)

Determine if the model touches a given relation.

void
touchOwners()

Touch the owning relations of the model.

array
getMorphs(string $name, string $type, string $id)

Get the polymorphic relationship columns.

string
getMorphClass()

Get the class name for polymorphic relations.

mixed
newRelatedInstance(string $class)

Create a new model instance for a related model.

array
getRelations()

Get all the loaded relations for the instance.

mixed
getRelation(string $relation)

Get a specified relationship.

bool
relationLoaded(string $key)

Determine if the given relation is loaded.

$this
setRelation(string $relation, mixed $value)

Set the specific relationship in the model.

$this
setRelations(array $relations)

Set the entire relations array on the model.

array
getTouchedRelations()

Get the relationships that are touched on save.

$this
setTouchedRelations(array $touches)

Set the relationships that are touched on save.

bool
touch()

Update the model's update timestamp.

void
updateTimestamps()

Update the creation and update timestamps.

$this
setCreatedAt(mixed $value)

Set the value of the "created at" attribute.

$this
setUpdatedAt(mixed $value)

Set the value of the "updated at" attribute.

Carbon
freshTimestamp()

Get a fresh timestamp for the model.

string
freshTimestampString()

Get a fresh timestamp for the model.

bool
usesTimestamps()

Determine if the model uses timestamps.

string
getCreatedAtColumn()

Get the name of the "created at" column.

string
getUpdatedAtColumn()

Get the name of the "updated at" column.

array
getHidden()

Get the hidden attributes for the model.

$this
setHidden(array $hidden)

Set the hidden attributes for the model.

void
addHidden(array|string|null $attributes = null)

Add hidden attributes for the model.

array
getVisible()

Get the visible attributes for the model.

$this
setVisible(array $visible)

Set the visible attributes for the model.

void
addVisible(array|string|null $attributes = null)

Add visible attributes for the model.

$this
makeVisible(array|string $attributes)

Make the given, typically hidden, attributes visible.

$this
makeHidden(array|string $attributes)

Make the given, typically visible, attributes hidden.

array
getFillable()

Get the fillable attributes for the model.

$this
fillable(array $fillable)

Set the fillable attributes for the model.

array
getGuarded()

Get the guarded attributes for the model.

$this
guard(array $guarded)

Set the guarded attributes for the model.

static void
unguard(bool $state = true)

Disable all mass assignable restrictions.

static void
reguard()

Enable the mass assignment restrictions.

static bool
isUnguarded()

Determine if current state is "unguarded".

static mixed
unguarded(callable $callback)

Run the given callable while being unguarded.

bool
isFillable(string $key)

Determine if the given attribute may be mass assigned.

bool
isGuarded(string $key)

Determine if the given key is guarded.

bool
totallyGuarded()

Determine if the model is totally guarded.

array
fillableFromArray(array $attributes)

Get the fillable attributes of a given array.

void
__construct(array $attributes = [])

Create a new Eloquent model instance.

from  Model
void
bootIfNotBooted()

Check if the model needs to be booted and if so, do it.

from  Model
static void
boot()

The "booting" method of the model.

from  Model
static void
bootTraits()

Boot all of the bootable traits on the model.

from  Model
static void
clearBootedModels()

Clear the list of booted models so they will be re-booted.

from  Model
$this
fill(array $attributes)

Fill the model with an array of attributes.

from  Model
$this
forceFill(array $attributes)

Fill the model with an array of attributes. Force mass assignment.

from  Model
string
removeTableFromKey(string $key)

Remove the table name from a given key.

from  Model
newInstance(array $attributes = [], bool $exists = false)

Create a new instance of the given model.

from  Model
newFromBuilder(array $attributes = [], string|null $connection = null)

Create a new model instance that is existing.

from  Model
static Builder
on(string|null $connection = null)

Begin querying the model on a given connection.

from  Model
static Builder
onWriteConnection()

Begin querying the model on the write connection.

from  Model
static Collection|Model[]
all(array|mixed $columns = ['*'])

Get all of the models from the database.

from  Model
static Builder|Model
with(array|string $relations)

Begin querying a model with eager loading.

from  Model
$this
load(array|string $relations)

Eager load relations on the model.

from  Model
int
increment(string $column, int $amount = 1, array $extra = [])

Increment a column's value by a given amount.

from  Model
int
decrement(string $column, int $amount = 1, array $extra = [])

Decrement a column's value by a given amount.

from  Model
int
incrementOrDecrement(string $column, int $amount, array $extra, string $method)

Run the increment or decrement method on the model.

from  Model
void
incrementOrDecrementAttributeValue(string $column, int $amount, array $extra, string $method)

Increment the underlying attribute value and sync with original.

from  Model
bool
update(array $attributes = [], array $options = [])

Update the model in the database.

from  Model
bool
push()

Save the model and all of its relationships.

from  Model
bool
save(array $options = [])

Save the model to the database.

from  Model
bool
saveOrFail(array $options = [])

Save the model to the database using transaction.

from  Model
void
finishSave(array $options)

Perform any actions that are necessary after the model is saved.

from  Model
bool
performUpdate(Builder $query)

Perform a model update operation.

from  Model
setKeysForSaveQuery(Builder $query)

Set the keys for a save update query.

from  Model
mixed
getKeyForSaveQuery()

Get the primary key value for a save query.

from  Model
bool
performInsert(Builder $query)

Perform a model insert operation.

from  Model
void
insertAndSetId(Builder $query, array $attributes)

Insert the given attributes and set the ID on the model.

from  Model
static int
destroy(array|int $ids)

Destroy the models for the given IDs.

from  Model
bool|null
delete()

Delete the model from the database.

from  Model
bool|null
forceDelete()

Force a hard delete on a soft deleted model.

from  Model
void
performDeleteOnModel()

Perform the actual delete query on this model instance.

from  Model
static Builder
query()

Begin querying the model.

from  Model
newQuery()

Get a new query builder for the model's table.

from  Model
newQueryWithoutScopes()

Get a new query builder that doesn't have any global scopes.

from  Model
newQueryWithoutScope(Scope|string $scope)

Get a new query instance without a given scope.

from  Model
newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

from  Model
newBaseQueryBuilder()

Get a new query builder instance for the connection.

from  Model
newCollection(array $models = [])

Create a new database notification collection instance.

newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null)

Create a new pivot model instance.

from  Model
array
toArray()

Convert the model instance to an array.

from  Model
string
toJson(int $options = 0)

Convert the model instance to JSON.

from  Model
array
jsonSerialize()

Convert the object into something JSON serializable.

from  Model
Model|null
fresh(array|string $with = [])

Reload a fresh model instance from the database.

from  Model
$this
refresh()

Reload the current model instance with fresh attributes from the database.

from  Model
replicate(array $except = null)

Clone the model into a new, non-existing instance.

from  Model
bool
is(Model $model)

Determine if two models have the same ID and belong to the same table.

from  Model
bool
isNot(Model $model)

Determine if two models are not the same.

from  Model
getConnection()

Get the database connection for the model.

from  Model
string
getConnectionName()

Get the current connection name for the model.

from  Model
$this
setConnection(string $name)

Set the connection associated with the model.

from  Model
static Connection
resolveConnection(string|null $connection = null)

Resolve a connection instance.

from  Model
getConnectionResolver()

Get the connection resolver instance.

from  Model
static void
setConnectionResolver(ConnectionResolverInterface $resolver)

Set the connection resolver instance.

from  Model
static void
unsetConnectionResolver()

Unset the connection resolver for models.

from  Model
string
getTable()

Get the table associated with the model.

from  Model
$this
setTable(string $table)

Set the table associated with the model.

from  Model
string
getKeyName()

Get the primary key for the model.

from  Model
$this
setKeyName(string $key)

Set the primary key for the model.

from  Model
string
getQualifiedKeyName()

Get the table qualified key name.

from  Model
string
getKeyType()

Get the auto-incrementing key type.

from  Model
$this
setKeyType(string $type)

Set the data type for the primary key.

from  Model
bool
getIncrementing()

Get the value indicating whether the IDs are incrementing.

from  Model
$this
setIncrementing(bool $value)

Set whether IDs are incrementing.

from  Model
mixed
getKey()

Get the value of the model's primary key.

from  Model
mixed
getQueueableId()

Get the queueable identity for the entity.

from  Model
mixed
getRouteKey()

Get the value of the model's route key.

from  Model
string
getRouteKeyName()

Get the route key for the model.

from  Model
string
getForeignKey()

Get the default foreign key name for the model.

from  Model
int
getPerPage()

Get the number of models to return per page.

from  Model
$this
setPerPage(int $perPage)

Set the number of models to return per page.

from  Model
mixed
__get(string $key)

Dynamically retrieve attributes on the model.

from  Model
void
__set(string $key, mixed $value)

Dynamically set attributes on the model.

from  Model
bool
offsetExists(mixed $offset)

Determine if the given attribute exists.

from  Model
mixed
offsetGet(mixed $offset)

Get the value for a given offset.

from  Model
void
offsetSet(mixed $offset, mixed $value)

Set the value for a given offset.

from  Model
void
offsetUnset(mixed $offset)

Unset the value for a given offset.

from  Model
bool
__isset(string $key)

Determine if an attribute or relation exists on the model.

from  Model
void
__unset(string $key)

Unset an attribute on the model.

from  Model
mixed
__call(string $method, array $parameters)

Handle dynamic method calls into the model.

from  Model
static mixed
__callStatic(string $method, array $parameters)

Handle dynamic static method calls into the method.

from  Model
string
__toString()

Convert the model to its string representation.

from  Model
void
__wakeup()

When a model is being unserialized, check if it needs to be booted.

from  Model
notifiable()

Get the notifiable entity that the notification belongs to.

void
markAsRead()

Mark the notification as read.

bool
read()

Determine if a notification has been read.

bool
unread()

Determine if a notification has not been read.

Details

in HasAttributes at line 78
array attributesToArray()

Convert the model's attributes to an array.

Return Value

array

in HasAttributes at line 114
protected array addDateAttributesToArray(array $attributes)

Add the date attributes to the attributes array.

Parameters

array $attributes

Return Value

array

in HasAttributes at line 136
protected array addMutatedAttributesToArray(array $attributes, array $mutatedAttributes)

Add the mutated attributes to the attributes array.

Parameters

array $attributes
array $mutatedAttributes

Return Value

array

in HasAttributes at line 164
protected array addCastAttributesToArray(array $attributes, array $mutatedAttributes)

Add the casted attributes to the attributes array.

Parameters

array $attributes
array $mutatedAttributes

Return Value

array

in HasAttributes at line 195
protected array getArrayableAttributes()

Get an attribute array of all arrayable attributes.

Return Value

array

in HasAttributes at line 205
protected array getArrayableAppends()

Get all of the appendable values that are arrayable.

Return Value

array

in HasAttributes at line 221
array relationsToArray()

Get the model's relationships in array form.

Return Value

array

in HasAttributes at line 265
protected array getArrayableRelations()

Get an attribute array of all arrayable relations.

Return Value

array

in HasAttributes at line 276
protected array getArrayableItems(array $values)

Get an attribute array of all arrayable values.

Parameters

array $values

Return Value

array

in HasAttributes at line 295
mixed getAttribute(string $key)

Get an attribute from the model.

Parameters

string $key

Return Value

mixed

in HasAttributes at line 325
mixed getAttributeValue(string $key)

Get a plain attribute (not a relationship).

Parameters

string $key

Return Value

mixed

in HasAttributes at line 360
protected mixed getAttributeFromArray(string $key)

Get an attribute from the $attributes array.

Parameters

string $key

Return Value

mixed

in HasAttributes at line 373
mixed getRelationValue(string $key)

Get a relationship.

Parameters

string $key

Return Value

mixed

in HasAttributes at line 398
protected mixed getRelationshipFromMethod(string $method)

Get a relationship value from a method.

Parameters

string $method

Return Value

mixed

Exceptions

LogicException

in HasAttributes at line 418
bool hasGetMutator(string $key)

Determine if a get mutator exists for an attribute.

Parameters

string $key

Return Value

bool

in HasAttributes at line 430
protected mixed mutateAttribute(string $key, mixed $value)

Get the value of an attribute using its mutator.

Parameters

string $key
mixed $value

Return Value

mixed

in HasAttributes at line 442
protected mixed mutateAttributeForArray(string $key, mixed $value)

Get the value of an attribute using its mutator for array conversion.

Parameters

string $key
mixed $value

Return Value

mixed

in HasAttributes at line 456
protected mixed castAttribute(string $key, mixed $value)

Cast an attribute to a native PHP type.

Parameters

string $key
mixed $value

Return Value

mixed

in HasAttributes at line 499
protected string getCastType(string $key)

Get the type of cast for a model attribute.

Parameters

string $key

Return Value

string

in HasAttributes at line 511
$this setAttribute(string $key, mixed $value)

Set a given attribute on the model.

Parameters

string $key
mixed $value

Return Value

$this

in HasAttributes at line 551
bool hasSetMutator(string $key)

Determine if a set mutator exists for an attribute.

Parameters

string $key

Return Value

bool

in HasAttributes at line 562
protected bool isDateAttribute(string $key)

Determine if the given attribute is a date or date castable.

Parameters

string $key

Return Value

bool

in HasAttributes at line 575
$this fillJsonAttribute(string $key, mixed $value)

Set a given JSON attribute on the model.

Parameters

string $key
mixed $value

Return Value

$this

in HasAttributes at line 594
protected $this getArrayAttributeWithValue(string $path, string $key, mixed $value)

Get an array attribute with the given key and value set.

Parameters

string $path
string $key
mixed $value

Return Value

$this

in HasAttributes at line 607
protected array getArrayAttributeByKey(string $key)

Get an array attribute or return an empty array if it is not set.

Parameters

string $key

Return Value

array

in HasAttributes at line 620
protected string castAttributeAsJson(string $key, mixed $value)

Cast the given attribute to JSON.

Parameters

string $key
mixed $value

Return Value

string

in HasAttributes at line 639
protected string asJson(mixed $value)

Encode the given value as JSON.

Parameters

mixed $value

Return Value

string

in HasAttributes at line 651
mixed fromJson(string $value, bool $asObject = false)

Decode the given JSON back into an array or object.

Parameters

string $value
bool $asObject

Return Value

mixed

in HasAttributes at line 662
protected Carbon asDate(mixed $value)

Return a timestamp as DateTime object with time set to 00:00:00.

Parameters

mixed $value

Return Value

Carbon

in HasAttributes at line 673
protected Carbon asDateTime(mixed $value)

Return a timestamp as DateTime object.

Parameters

mixed $value

Return Value

Carbon

in HasAttributes at line 719
protected bool isStandardDateFormat(string $value)

Determine if the given value is a standard date format.

Parameters

string $value

Return Value

bool

in HasAttributes at line 730
string fromDateTime(DateTime|int $value)

Convert a DateTime to a storable string.

Parameters

DateTime|int $value

Return Value

string

in HasAttributes at line 743
protected int asTimestamp(mixed $value)

Return a timestamp as unix timestamp.

Parameters

mixed $value

Return Value

int

in HasAttributes at line 754
protected string serializeDate(DateTimeInterface $date)

Prepare a date for array / JSON serialization.

Parameters

DateTimeInterface $date

Return Value

string

in HasAttributes at line 764
array getDates()

Get the attributes that should be converted to dates.

Return Value

array

in HasAttributes at line 778
protected string getDateFormat()

Get the format for database stored dates.

Return Value

string

in HasAttributes at line 789
$this setDateFormat(string $format)

Set the date format used by the model.

Parameters

string $format

Return Value

$this

in HasAttributes at line 803
bool hasCast(string $key, array|string|null $types = null)

Determine whether an attribute should be cast to a native type.

Parameters

string $key
array|string|null $types

Return Value

bool

in HasAttributes at line 817
array getCasts()

Get the casts array.

Return Value

array

in HasAttributes at line 832
protected bool isDateCastable(string $key)

Determine whether a value is Date / DateTime castable for inbound manipulation.

Parameters

string $key

Return Value

bool

in HasAttributes at line 843
protected bool isJsonCastable(string $key)

Determine whether a value is JSON castable for inbound manipulation.

Parameters

string $key

Return Value

bool

in HasAttributes at line 853
array getAttributes()

Get all of the current attributes on the model.

Return Value

array

in HasAttributes at line 865
$this setRawAttributes(array $attributes, bool $sync = false)

Set the array of model attributes. No checking is done.

Parameters

array $attributes
bool $sync

Return Value

$this

in HasAttributes at line 883
mixed|array getOriginal(string|null $key = null, mixed $default = null)

Get the model's original attribute values.

Parameters

string|null $key
mixed $default

Return Value

mixed|array

in HasAttributes at line 893
$this syncOriginal()

Sync the original attributes with the current.

Return Value

$this

in HasAttributes at line 906
$this syncOriginalAttribute(string $attribute)

Sync a single original attribute with its current value.

Parameters

string $attribute

Return Value

$this

in HasAttributes at line 919
bool isDirty(array|string|null $attributes = null)

Determine if the model or given attribute(s) have been modified.

Parameters

array|string|null $attributes

Return Value

bool

in HasAttributes at line 951
bool isClean(array|string|null $attributes = null)

Determine if the model or given attribute(s) have remained the same.

Parameters

array|string|null $attributes

Return Value

bool

in HasAttributes at line 961
array getDirty()

Get the attributes that have been changed since last sync.

Return Value

array

in HasAttributes at line 983
protected bool originalIsNumericallyEquivalent(string $key)

Determine if the new and old values for a given key are numerically equivalent.

Parameters

string $key

Return Value

bool

in HasAttributes at line 1002
$this append(array|string $attributes)

Append attributes to query when building a query.

Parameters

array|string $attributes

Return Value

$this

in HasAttributes at line 1017
$this setAppends(array $appends)

Set the accessors to append to model arrays.

Parameters

array $appends

Return Value

$this

in HasAttributes at line 1029
array getMutatedAttributes()

Get the mutated attributes for a given instance.

Return Value

array

in HasAttributes at line 1046
static void cacheMutatedAttributes(string $class)

Extract and cache all the mutated attributes of a class.

Parameters

string $class

Return Value

void

in HasAttributes at line 1059
static protected array getMutatorMethods(mixed $class)

Get all of the attribute mutator methods.

Parameters

mixed $class

Return Value

array

in HasEvents at line 33
static void observe(object|string $class)

Register an observer with the Model.

Parameters

object|string $class

Return Value

void

in HasEvents at line 54
array getObservableEvents()

Get the observable event names.

Return Value

array

in HasEvents at line 72
$this setObservableEvents(array $observables)

Set the observable event names.

Parameters

array $observables

Return Value

$this

in HasEvents at line 85
void addObservableEvents(array|mixed $observables)

Add an observable event name.

Parameters

array|mixed $observables

Return Value

void

in HasEvents at line 98
void removeObservableEvents(array|mixed $observables)

Remove an observable event name.

Parameters

array|mixed $observables

Return Value

void

in HasEvents at line 112
static protected void registerModelEvent(string $event, Closure|string $callback)

Register a model event with the dispatcher.

Parameters

string $event
Closure|string $callback

Return Value

void

in HasEvents at line 128
protected mixed fireModelEvent(string $event, bool $halt = true)

Fire the given event for the model.

Parameters

string $event
bool $halt

Return Value

mixed

in HasEvents at line 159
protected mixed|null fireCustomModelEvent(string $event, string $method)

Fire a custom model event for the given event.

Parameters

string $event
string $method

Return Value

mixed|null

in HasEvents at line 178
protected mixed filterModelEventResults(mixed $result)

Filter the model event results.

Parameters

mixed $result

Return Value

mixed

in HasEvents at line 195
static void saving(Closure|string $callback)

Register a saving model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 206
static void saved(Closure|string $callback)

Register a saved model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 217
static void updating(Closure|string $callback)

Register an updating model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 228
static void updated(Closure|string $callback)

Register an updated model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 239
static void creating(Closure|string $callback)

Register a creating model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 250
static void created(Closure|string $callback)

Register a created model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 261
static void deleting(Closure|string $callback)

Register a deleting model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 272
static void deleted(Closure|string $callback)

Register a deleted model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

in HasEvents at line 282
static void flushEventListeners()

Remove all of the event listeners for the model.

Return Value

void

in HasEvents at line 300
static Dispatcher getEventDispatcher()

Get the event dispatcher instance.

Return Value

Dispatcher

in HasEvents at line 311
static void setEventDispatcher(Dispatcher $dispatcher)

Set the event dispatcher instance.

Parameters

Dispatcher $dispatcher

Return Value

void

in HasEvents at line 321
static void unsetEventDispatcher()

Unset the event dispatcher for models.

Return Value

void

in HasGlobalScopes at line 21
static mixed addGlobalScope(Scope|Closure|string $scope, Closure $implementation = null)

Register a new global scope on the model.

Parameters

Scope|Closure|string $scope
Closure $implementation

Return Value

mixed

Exceptions

InvalidArgumentException

in HasGlobalScopes at line 40
static bool hasGlobalScope(Scope|string $scope)

Determine if a model has a global scope.

Parameters

Scope|string $scope

Return Value

bool

in HasGlobalScopes at line 51
static Scope|Closure|null getGlobalScope(Scope|string $scope)

Get a global scope registered with the model.

Parameters

Scope|string $scope

Return Value

Scope|Closure|null

in HasGlobalScopes at line 67
array getGlobalScopes()

Get the global scopes for this class instance.

Return Value

array

in HasRelationships at line 54
HasOne hasOne(string $related, string $foreignKey = null, string $localKey = null)

Define a one-to-one relationship.

Parameters

string $related
string $foreignKey
string $localKey

Return Value

HasOne

in HasRelationships at line 75
MorphOne morphOne(string $related, string $name, string $type = null, string $id = null, string $localKey = null)

Define a polymorphic one-to-one relationship.

Parameters

string $related
string $name
string $type
string $id
string $localKey

Return Value

MorphOne

in HasRelationships at line 97
BelongsTo belongsTo(string $related, string $foreignKey = null, string $ownerKey = null, string $relation = null)

Define an inverse one-to-one or many relationship.

Parameters

string $related
string $foreignKey
string $ownerKey
string $relation

Return Value

BelongsTo

in HasRelationships at line 133
MorphTo morphTo(string $name = null, string $type = null, string $id = null)

Define a polymorphic, inverse one-to-one or many relationship.

Parameters

string $name
string $type
string $id

Return Value

MorphTo

in HasRelationships at line 160
protected MorphTo morphEagerTo(string $name, string $type, string $id)

Define a polymorphic, inverse one-to-one or many relationship.

Parameters

string $name
string $type
string $id

Return Value

MorphTo

in HasRelationships at line 176
protected MorphTo morphInstanceTo(string $target, string $name, string $type, string $id)

Define a polymorphic, inverse one-to-one or many relationship.

Parameters

string $target
string $name
string $type
string $id

Return Value

MorphTo

in HasRelationships at line 193
static string getActualClassNameForMorph(string $class)

Retrieve the actual class name for a given morph class.

Parameters

string $class

Return Value

string

in HasRelationships at line 203
protected string guessBelongsToRelation()

Guess the "belongs to" relationship name.

Return Value

string

in HasRelationships at line 218
HasMany hasMany(string $related, string $foreignKey = null, string $localKey = null)

Define a one-to-many relationship.

Parameters

string $related
string $foreignKey
string $localKey

Return Value

HasMany

in HasRelationships at line 241
HasManyThrough hasManyThrough(string $related, string $through, string|null $firstKey = null, string|null $secondKey = null, string|null $localKey = null)

Define a has-many-through relationship.

Parameters

string $related
string $through
string|null $firstKey
string|null $secondKey
string|null $localKey

Return Value

HasManyThrough

in HasRelationships at line 266
MorphMany morphMany(string $related, string $name, string $type = null, string $id = null, string $localKey = null)

Define a polymorphic one-to-many relationship.

Parameters

string $related
string $name
string $type
string $id
string $localKey

Return Value

MorphMany

in HasRelationships at line 292
BelongsToMany belongsToMany(string $related, string $table = null, string $foreignKey = null, string $relatedKey = null, string $relation = null)

Define a many-to-many relationship.

Parameters

string $related
string $table
string $foreignKey
string $relatedKey
string $relation

Return Value

BelongsToMany

in HasRelationships at line 333
MorphToMany morphToMany(string $related, string $name, string $table = null, string $foreignKey = null, string $relatedKey = null, bool $inverse = false)

Define a polymorphic many-to-many relationship.

Parameters

string $related
string $name
string $table
string $foreignKey
string $relatedKey
bool $inverse

Return Value

MorphToMany

in HasRelationships at line 367
MorphToMany morphedByMany(string $related, string $name, string $table = null, string $foreignKey = null, string $relatedKey = null)

Define a polymorphic, inverse many-to-many relationship.

Parameters

string $related
string $name
string $table
string $foreignKey
string $relatedKey

Return Value

MorphToMany

in HasRelationships at line 384
protected string guessBelongsToManyRelation()

Get the relationship name of the belongs to many.

Return Value

string

in HasRelationships at line 399
string joiningTable(string $related)

Get the joining table name for a many-to-many relation.

Parameters

string $related

Return Value

string

in HasRelationships at line 423
bool touches(string $relation)

Determine if the model touches a given relation.

Parameters

string $relation

Return Value

bool

in HasRelationships at line 433
void touchOwners()

Touch the owning relations of the model.

Return Value

void

in HasRelationships at line 458
protected array getMorphs(string $name, string $type, string $id)

Get the polymorphic relationship columns.

Parameters

string $name
string $type
string $id

Return Value

array

in HasRelationships at line 468
string getMorphClass()

Get the class name for polymorphic relations.

Return Value

string

in HasRelationships at line 485
protected mixed newRelatedInstance(string $class)

Create a new model instance for a related model.

Parameters

string $class

Return Value

mixed

in HasRelationships at line 499
array getRelations()

Get all the loaded relations for the instance.

Return Value

array

in HasRelationships at line 510
mixed getRelation(string $relation)

Get a specified relationship.

Parameters

string $relation

Return Value

mixed

in HasRelationships at line 521
bool relationLoaded(string $key)

Determine if the given relation is loaded.

Parameters

string $key

Return Value

bool

in HasRelationships at line 533
$this setRelation(string $relation, mixed $value)

Set the specific relationship in the model.

Parameters

string $relation
mixed $value

Return Value

$this

in HasRelationships at line 546
$this setRelations(array $relations)

Set the entire relations array on the model.

Parameters

array $relations

Return Value

$this

in HasRelationships at line 558
array getTouchedRelations()

Get the relationships that are touched on save.

Return Value

array

in HasRelationships at line 569
$this setTouchedRelations(array $touches)

Set the relationships that are touched on save.

Parameters

array $touches

Return Value

$this

in HasTimestamps at line 21
bool touch()

Update the model's update timestamp.

Return Value

bool

in HasTimestamps at line 37
protected void updateTimestamps()

Update the creation and update timestamps.

Return Value

void

in HasTimestamps at line 56
$this setCreatedAt(mixed $value)

Set the value of the "created at" attribute.

Parameters

mixed $value

Return Value

$this

in HasTimestamps at line 69
$this setUpdatedAt(mixed $value)

Set the value of the "updated at" attribute.

Parameters

mixed $value

Return Value

$this

in HasTimestamps at line 81
Carbon freshTimestamp()

Get a fresh timestamp for the model.

Return Value

Carbon

in HasTimestamps at line 91
string freshTimestampString()

Get a fresh timestamp for the model.

Return Value

string

in HasTimestamps at line 101
bool usesTimestamps()

Determine if the model uses timestamps.

Return Value

bool

in HasTimestamps at line 111
string getCreatedAtColumn()

Get the name of the "created at" column.

Return Value

string

in HasTimestamps at line 121
string getUpdatedAtColumn()

Get the name of the "updated at" column.

Return Value

string

in HidesAttributes at line 26
array getHidden()

Get the hidden attributes for the model.

Return Value

array

in HidesAttributes at line 37
$this setHidden(array $hidden)

Set the hidden attributes for the model.

Parameters

array $hidden

Return Value

$this

in HidesAttributes at line 50
void addHidden(array|string|null $attributes = null)

Add hidden attributes for the model.

Parameters

array|string|null $attributes

Return Value

void

in HidesAttributes at line 62
array getVisible()

Get the visible attributes for the model.

Return Value

array

in HidesAttributes at line 73
$this setVisible(array $visible)

Set the visible attributes for the model.

Parameters

array $visible

Return Value

$this

in HidesAttributes at line 86
void addVisible(array|string|null $attributes = null)

Add visible attributes for the model.

Parameters

array|string|null $attributes

Return Value

void

in HidesAttributes at line 99
$this makeVisible(array|string $attributes)

Make the given, typically hidden, attributes visible.

Parameters

array|string $attributes

Return Value

$this

in HidesAttributes at line 116
$this makeHidden(array|string $attributes)

Make the given, typically visible, attributes hidden.

Parameters

array|string $attributes

Return Value

$this

in GuardsAttributes at line 35
array getFillable()

Get the fillable attributes for the model.

Return Value

array

in GuardsAttributes at line 46
$this fillable(array $fillable)

Set the fillable attributes for the model.

Parameters

array $fillable

Return Value

$this

in GuardsAttributes at line 58
array getGuarded()

Get the guarded attributes for the model.

Return Value

array

in GuardsAttributes at line 69
$this guard(array $guarded)

Set the guarded attributes for the model.

Parameters

array $guarded

Return Value

$this

in GuardsAttributes at line 82
static void unguard(bool $state = true)

Disable all mass assignable restrictions.

Parameters

bool $state

Return Value

void

in GuardsAttributes at line 92
static void reguard()

Enable the mass assignment restrictions.

Return Value

void

in GuardsAttributes at line 102
static bool isUnguarded()

Determine if current state is "unguarded".

Return Value

bool

in GuardsAttributes at line 113
static mixed unguarded(callable $callback)

Run the given callable while being unguarded.

Parameters

callable $callback

Return Value

mixed

in GuardsAttributes at line 134
bool isFillable(string $key)

Determine if the given attribute may be mass assigned.

Parameters

string $key

Return Value

bool

in GuardsAttributes at line 164
bool isGuarded(string $key)

Determine if the given key is guarded.

Parameters

string $key

Return Value

bool

in GuardsAttributes at line 174
bool totallyGuarded()

Determine if the model is totally guarded.

Return Value

bool

in GuardsAttributes at line 185
protected array fillableFromArray(array $attributes)

Get the fillable attributes of a given array.

Parameters

array $attributes

Return Value

array

in Model at line 150
void __construct(array $attributes = [])

Create a new Eloquent model instance.

Parameters

array $attributes

Return Value

void

in Model at line 164
protected void bootIfNotBooted()

Check if the model needs to be booted and if so, do it.

Return Value

void

in Model at line 182
static protected void boot()

The "booting" method of the model.

Return Value

void

in Model at line 192
static protected void bootTraits()

Boot all of the bootable traits on the model.

Return Value

void

in Model at line 208
static void clearBootedModels()

Clear the list of booted models so they will be re-booted.

Return Value

void

in Model at line 223
$this fill(array $attributes)

Fill the model with an array of attributes.

Parameters

array $attributes

Return Value

$this

Exceptions

MassAssignmentException

in Model at line 249
$this forceFill(array $attributes)

Fill the model with an array of attributes. Force mass assignment.

Parameters

array $attributes

Return Value

$this

in Model at line 262
protected string removeTableFromKey(string $key)

Remove the table name from a given key.

Parameters

string $key

Return Value

string

in Model at line 274
Model newInstance(array $attributes = [], bool $exists = false)

Create a new instance of the given model.

Parameters

array $attributes
bool $exists

Return Value

Model

in Model at line 297
Model newFromBuilder(array $attributes = [], string|null $connection = null)

Create a new model instance that is existing.

Parameters

array $attributes
string|null $connection

Return Value

Model

in Model at line 314
static Builder on(string|null $connection = null)

Begin querying the model on a given connection.

Parameters

string|null $connection

Return Value

Builder

in Model at line 331
static Builder onWriteConnection()

Begin querying the model on the write connection.

Return Value

Builder

in Model at line 344
static Collection|Model[] all(array|mixed $columns = ['*'])

Get all of the models from the database.

Parameters

array|mixed $columns

Return Value

Collection|Model[]

in Model at line 357
static Builder|Model with(array|string $relations)

Begin querying a model with eager loading.

Parameters

array|string $relations

Return Value

Builder|Model

in Model at line 370
$this load(array|string $relations)

Eager load relations on the model.

Parameters

array|string $relations

Return Value

$this

in Model at line 389
protected int increment(string $column, int $amount = 1, array $extra = [])

Increment a column's value by a given amount.

Parameters

string $column
int $amount
array $extra

Return Value

int

in Model at line 402
protected int decrement(string $column, int $amount = 1, array $extra = [])

Decrement a column's value by a given amount.

Parameters

string $column
int $amount
array $extra

Return Value

int

in Model at line 416
protected int incrementOrDecrement(string $column, int $amount, array $extra, string $method)

Run the increment or decrement method on the model.

Parameters

string $column
int $amount
array $extra
string $method

Return Value

int

in Model at line 440
protected void incrementOrDecrementAttributeValue(string $column, int $amount, array $extra, string $method)

Increment the underlying attribute value and sync with original.

Parameters

string $column
int $amount
array $extra
string $method

Return Value

void

in Model at line 456
bool update(array $attributes = [], array $options = [])

Update the model in the database.

Parameters

array $attributes
array $options

Return Value

bool

in Model at line 470
bool push()

Save the model and all of its relationships.

Return Value

bool

in Model at line 499
bool save(array $options = [])

Save the model to the database.

Parameters

array $options

Return Value

bool

in Model at line 543
bool saveOrFail(array $options = [])

Save the model to the database using transaction.

Parameters

array $options

Return Value

bool

Exceptions

Throwable

in Model at line 556
protected void finishSave(array $options)

Perform any actions that are necessary after the model is saved.

Parameters

array $options

Return Value

void

in Model at line 573
protected bool performUpdate(Builder $query)

Perform a model update operation.

Parameters

Builder $query

Return Value

bool

in Model at line 609
protected Builder setKeysForSaveQuery(Builder $query)

Set the keys for a save update query.

Parameters

Builder $query

Return Value

Builder

in Model at line 621
protected mixed getKeyForSaveQuery()

Get the primary key value for a save query.

Return Value

mixed

in Model at line 634
protected bool performInsert(Builder $query)

Perform a model insert operation.

Parameters

Builder $query

Return Value

bool

in Model at line 686
protected void insertAndSetId(Builder $query, array $attributes)

Insert the given attributes and set the ID on the model.

Parameters

Builder $query
array $attributes

Return Value

void

in Model at line 699
static int destroy(array|int $ids)

Destroy the models for the given IDs.

Parameters

array|int $ids

Return Value

int

in Model at line 729
bool|null delete()

Delete the model from the database.

Return Value

bool|null

Exceptions

Exception

in Model at line 770
bool|null forceDelete()

Force a hard delete on a soft deleted model.

This method protects developers from running forceDelete when trait is missing.

Return Value

bool|null

in Model at line 780
protected void performDeleteOnModel()

Perform the actual delete query on this model instance.

Return Value

void

in Model at line 790
static Builder query()

Begin querying the model.

Return Value

Builder

in Model at line 800
Builder newQuery()

Get a new query builder for the model's table.

Return Value

Builder

in Model at line 816
Builder|Model newQueryWithoutScopes()

Get a new query builder that doesn't have any global scopes.

Return Value

Builder|Model

in Model at line 834
Builder newQueryWithoutScope(Scope|string $scope)

Get a new query instance without a given scope.

Parameters

Scope|string $scope

Return Value

Builder

in Model at line 847
Builder|Model newEloquentBuilder(Builder $query)

Create a new Eloquent query builder for the model.

Parameters

Builder $query

Return Value

Builder|Model

in Model at line 857
protected Builder newBaseQueryBuilder()

Get a new query builder instance for the connection.

Return Value

Builder

at line 86
Collection newCollection(array $models = [])

Create a new database notification collection instance.

Parameters

array $models

Return Value

Collection

in Model at line 887
Pivot newPivot(Model $parent, array $attributes, string $table, bool $exists, string|null $using = null)

Create a new pivot model instance.

Parameters

Model $parent
array $attributes
string $table
bool $exists
string|null $using

Return Value

Pivot

in Model at line 898
array toArray()

Convert the model instance to an array.

Return Value

array

in Model at line 911
string toJson(int $options = 0)

Convert the model instance to JSON.

Parameters

int $options

Return Value

string

Exceptions

JsonEncodingException

in Model at line 927
array jsonSerialize()

Convert the object into something JSON serializable.

Return Value

array

in Model at line 938
Model|null fresh(array|string $with = [])

Reload a fresh model instance from the database.

Parameters

array|string $with

Return Value

Model|null

in Model at line 955
$this refresh()

Reload the current model instance with fresh attributes from the database.

Return Value

$this

in Model at line 974
Model replicate(array $except = null)

Clone the model into a new, non-existing instance.

Parameters

array $except

Return Value

Model

in Model at line 999
bool is(Model $model)

Determine if two models have the same ID and belong to the same table.

Parameters

Model $model

Return Value

bool

in Model at line 1012
bool isNot(Model $model)

Determine if two models are not the same.

Parameters

Model $model

Return Value

bool

in Model at line 1022
Connection getConnection()

Get the database connection for the model.

Return Value

Connection

in Model at line 1032
string getConnectionName()

Get the current connection name for the model.

Return Value

string

in Model at line 1043
$this setConnection(string $name)

Set the connection associated with the model.

Parameters

string $name

Return Value

$this

in Model at line 1056
static Connection resolveConnection(string|null $connection = null)

Resolve a connection instance.

Parameters

string|null $connection

Return Value

Connection

in Model at line 1066
static ConnectionResolverInterface getConnectionResolver()

Get the connection resolver instance.

in Model at line 1077
static void setConnectionResolver(ConnectionResolverInterface $resolver)

Set the connection resolver instance.

Parameters

ConnectionResolverInterface $resolver

Return Value

void

in Model at line 1087
static void unsetConnectionResolver()

Unset the connection resolver for models.

Return Value

void

in Model at line 1097
string getTable()

Get the table associated with the model.

Return Value

string

in Model at line 1112
$this setTable(string $table)

Set the table associated with the model.

Parameters

string $table

Return Value

$this

in Model at line 1124
string getKeyName()

Get the primary key for the model.

Return Value

string

in Model at line 1135
$this setKeyName(string $key)

Set the primary key for the model.

Parameters

string $key

Return Value

$this

in Model at line 1147
string getQualifiedKeyName()

Get the table qualified key name.

Return Value

string

in Model at line 1157
string getKeyType()

Get the auto-incrementing key type.

Return Value

string

in Model at line 1168
$this setKeyType(string $type)

Set the data type for the primary key.

Parameters

string $type

Return Value

$this

in Model at line 1180
bool getIncrementing()

Get the value indicating whether the IDs are incrementing.

Return Value

bool

in Model at line 1191
$this setIncrementing(bool $value)

Set whether IDs are incrementing.

Parameters

bool $value

Return Value

$this

in Model at line 1203
mixed getKey()

Get the value of the model's primary key.

Return Value

mixed

in Model at line 1213
mixed getQueueableId()

Get the queueable identity for the entity.

Return Value

mixed

in Model at line 1223
mixed getRouteKey()

Get the value of the model's route key.

Return Value

mixed

in Model at line 1233
string getRouteKeyName()

Get the route key for the model.

Return Value

string

in Model at line 1243
string getForeignKey()

Get the default foreign key name for the model.

Return Value

string

in Model at line 1253
int getPerPage()

Get the number of models to return per page.

Return Value

int

in Model at line 1264
$this setPerPage(int $perPage)

Set the number of models to return per page.

Parameters

int $perPage

Return Value

$this

in Model at line 1277
mixed __get(string $key)

Dynamically retrieve attributes on the model.

Parameters

string $key

Return Value

mixed

in Model at line 1289
void __set(string $key, mixed $value)

Dynamically set attributes on the model.

Parameters

string $key
mixed $value

Return Value

void

in Model at line 1300
bool offsetExists(mixed $offset)

Determine if the given attribute exists.

Parameters

mixed $offset

Return Value

bool

in Model at line 1311
mixed offsetGet(mixed $offset)

Get the value for a given offset.

Parameters

mixed $offset

Return Value

mixed

in Model at line 1323
void offsetSet(mixed $offset, mixed $value)

Set the value for a given offset.

Parameters

mixed $offset
mixed $value

Return Value

void

in Model at line 1334
void offsetUnset(mixed $offset)

Unset the value for a given offset.

Parameters

mixed $offset

Return Value

void

in Model at line 1345
bool __isset(string $key)

Determine if an attribute or relation exists on the model.

Parameters

string $key

Return Value

bool

in Model at line 1356
void __unset(string $key)

Unset an attribute on the model.

Parameters

string $key

Return Value

void

in Model at line 1368
mixed __call(string $method, array $parameters)

Handle dynamic method calls into the model.

Parameters

string $method
array $parameters

Return Value

mixed

in Model at line 1384
static mixed __callStatic(string $method, array $parameters)

Handle dynamic static method calls into the method.

Parameters

string $method
array $parameters

Return Value

mixed

in Model at line 1394
string __toString()

Convert the model to its string representation.

Return Value

string

in Model at line 1404
void __wakeup()

When a model is being unserialized, check if it needs to be booted.

Return Value

void

at line 43
notifiable()

Get the notifiable entity that the notification belongs to.

at line 53
void markAsRead()

Mark the notification as read.

Return Value

void

at line 65
bool read()

Determine if a notification has been read.

Return Value

bool

at line 75
bool unread()

Determine if a notification has not been read.

Return Value

bool