+
+
+
+ __call()
+
+
+
+
+
+ Handle dynamic method calls into the model.
+
+
+ public
+ __call(string $method, array<string|int, mixed> $parameters) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $method
+ : string
+
+ -
+
+
+ -
+ $parameters
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __callStatic()
+
+
+
+
+
+ Handle dynamic static method calls into the model.
+
+
+ public
+ static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $method
+ : string
+
+ -
+
+
+ -
+ $parameters
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __construct()
+
+
+
+
+
+ Create a new Eloquent model instance.
+
+
+ public
+ __construct([array<string|int, mixed> $attributes = [] ]) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __get()
+
+
+
+
+
+ Dynamically retrieve attributes on the model.
+
+
+ public
+ __get(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __isset()
+
+
+
+
+
+ Determine if an attribute or relation exists on the model.
+
+
+ public
+ __isset(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ __set()
+
+
+
+
+
+ Dynamically set attributes on the model.
+
+
+ public
+ __set(string $key, mixed $value) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __sleep()
+
+
+
+
+
+ Prepare the object for serialization.
+
+
+ public
+ __sleep() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ __toString()
+
+
+
+
+
+ Convert the model to its string representation.
+
+
+ public
+ __toString() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ __unset()
+
+
+
+
+
+ Unset an attribute on the model.
+
+
+ public
+ __unset(string $key) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ __wakeup()
+
+
+
+
+
+ When a model is being unserialized, check if it needs to be booted.
+
+
+ public
+ __wakeup() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ addGlobalScope()
+
+
+
+
+
+ Register a new global scope on the model.
+
+
+ public
+ static addGlobalScope(Scope|Closure|string $scope[, Closure|null $implementation = null ]) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : Scope|Closure|string
+
+ -
+
+
+ -
+ $implementation
+ : Closure|null
+ = null
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidArgumentException
+
+
+
+
+
+
+
+
+
+
+
+ addObservableEvents()
+
+
+
+
+
+ Add an observable event name.
+
+
+ public
+ addObservableEvents(array<string|int, mixed>|mixed $observables) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $observables
+ : array<string|int, mixed>|mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ all()
+
+
+
+
+
+ Get all of the models from the database.
+
+
+ public
+ static all([array<string|int, mixed>|mixed $columns = ['*'] ]) : Collection|array<string|int, static>
+
+
+
+
+
+ Parameters
+
+ -
+ $columns
+ : array<string|int, mixed>|mixed
+ = ['*']
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Collection|array<string|int, static>
+
+
+
+
+
+ append()
+
+
+
+
+
+ Append attributes to query when building a query.
+
+
+ public
+ append(array<string|int, mixed>|string $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ attributesToArray()
+
+
+
+
+
+ Convert the model's attributes to an array.
+
+
+ public
+ attributesToArray() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ belongsTo()
+
+
+
+
+
+ Define an inverse one-to-one or many relationship.
+
+
+ public
+ belongsTo(string $related[, string|null $foreignKey = null ][, string|null $ownerKey = null ][, string|null $relation = null ]) : BelongsTo
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $foreignKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $ownerKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relation
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ belongsToMany()
+
+
+
+
+
+ Define a many-to-many relationship.
+
+
+ public
+ belongsToMany(string $related[, string|null $table = null ][, string|null $foreignPivotKey = null ][, string|null $relatedPivotKey = null ][, string|null $parentKey = null ][, string|null $relatedKey = null ][, string|null $relation = null ]) : BelongsToMany
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $table
+ : string|null
+ = null
+ -
+
+
+ -
+ $foreignPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $parentKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relation
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ broadcastChannel()
+
+
+
+
+
+ Get the broadcast channel name that is associated with the given entity.
+
+
+ public
+ broadcastChannel() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ broadcastChannelRoute()
+
+
+
+
+
+ Get the broadcast channel route definition that is associated with the given entity.
+
+
+ public
+ broadcastChannelRoute() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ cacheMutatedAttributes()
+
+
+
+
+
+ Extract and cache all the mutated attributes of a class.
+
+
+ public
+ static cacheMutatedAttributes(string $class) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ callNamedScope()
+
+
+
+
+
+ Apply the given named scope if possible.
+
+
+ public
+ callNamedScope(string $scope[, array<string|int, mixed> $parameters = [] ]) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : string
+
+ -
+
+
+ -
+ $parameters
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ clearBootedModels()
+
+
+
+
+
+ Clear the list of booted models so they will be re-booted.
+
+
+ public
+ static clearBootedModels() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ created()
+
+
+
+
+
+ Register a created model event with the dispatcher.
+
+
+ public
+ static created(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ creating()
+
+
+
+
+
+ Register a creating model event with the dispatcher.
+
+
+ public
+ static creating(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ delete()
+
+
+
+
+
+ Delete the model from the database.
+
+
+ public
+ delete() : bool|null
+
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ LogicException
+
+
+
+
+
+
+
+
+ Return values
+ bool|null
+
+
+
+
+
+ deleted()
+
+
+
+
+
+ Register a deleted model event with the dispatcher.
+
+
+ public
+ static deleted(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ deleteOrFail()
+
+
+
+
+
+ Delete the model from the database within a transaction.
+
+
+ public
+ deleteOrFail() : bool|null
+
+
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ Throwable
+
+
+
+
+
+
+
+
+ Return values
+ bool|null
+
+
+
+
+
+ deleting()
+
+
+
+
+
+ Register a deleting model event with the dispatcher.
+
+
+ public
+ static deleting(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ destroy()
+
+
+
+
+
+ Destroy the models for the given IDs.
+
+
+ public
+ static destroy(Collection|array<string|int, mixed>|int|string $ids) : int
+
+
+
+
+
+ Parameters
+
+ -
+ $ids
+ : Collection|array<string|int, mixed>|int|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ encryptUsing()
+
+
+
+
+
+ Set the encrypter instance that will be used to encrypt attributes.
+
+
+ public
+ static encryptUsing(Encrypter $encrypter) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $encrypter
+ : Encrypter
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ escapeWhenCastingToString()
+
+
+
+
+
+ Indicate that the object's string representation should be escaped when __toString is invoked.
+
+
+ public
+ escapeWhenCastingToString([bool $escape = true ]) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $escape
+ : bool
+ = true
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ fill()
+
+
+
+
+
+ Fill the model with an array of attributes.
+
+
+ public
+ fill(array<string|int, mixed> $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ MassAssignmentException
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ fillable()
+
+
+
+
+
+ Set the fillable attributes for the model.
+
+
+ public
+ fillable(array<string|int, mixed> $fillable) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $fillable
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ fillJsonAttribute()
+
+
+
+
+
+ Set a given JSON attribute on the model.
+
+
+ public
+ fillJsonAttribute(string $key, mixed $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ flushEventListeners()
+
+
+
+
+
+ Remove all of the event listeners for the model.
+
+
+ public
+ static flushEventListeners() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ forceDelete()
+
+
+
+
+
+ Force a hard delete on a soft deleted model.
+
+
+ public
+ forceDelete() : bool|null
+
+
+
+
+ This method protects developers from running forceDelete when the trait is missing.
+
+
+
+
+
+
+
+
+ Return values
+ bool|null
+
+
+
+
+
+ forceFill()
+
+
+
+
+
+ Fill the model with an array of attributes. Force mass assignment.
+
+
+ public
+ forceFill(array<string|int, mixed> $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ fresh()
+
+
+
+
+
+ Reload a fresh model instance from the database.
+
+
+ public
+ fresh([array<string|int, mixed>|string $with = [] ]) : static|null
+
+
+
+
+
+ Parameters
+
+ -
+ $with
+ : array<string|int, mixed>|string
+ = []
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ static|null
+
+
+
+
+
+ freshTimestamp()
+
+
+
+
+
+ Get a fresh timestamp for the model.
+
+
+ public
+ freshTimestamp() : Carbon
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ freshTimestampString()
+
+
+
+
+
+ Get a fresh timestamp for the model.
+
+
+ public
+ freshTimestampString() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ fromDateTime()
+
+
+
+
+
+ Convert a DateTime to a storable string.
+
+
+ public
+ fromDateTime(mixed $value) : string|null
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ fromEncryptedString()
+
+
+
+
+
+ Decrypt the given encrypted string.
+
+
+ public
+ fromEncryptedString(string $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ fromFloat()
+
+
+
+
+
+ Decode the given float.
+
+
+ public
+ fromFloat(mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ fromJson()
+
+
+
+
+
+ Decode the given JSON back into an array or object.
+
+
+ public
+ fromJson(string $value[, bool $asObject = false ]) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : string
+
+ -
+
+
+ -
+ $asObject
+ : bool
+ = false
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Retrieve the actual class name for a given morph class.
+
+
+ public
+ static getActualClassNameForMorph(string $class) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getAttribute()
+
+
+
+
+
+ Get an attribute from the model.
+
+
+ public
+ getAttribute(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getAttributes()
+
+
+
+
+
+ Get all of the current attributes on the model.
+
+
+ public
+ getAttributes() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getAttributeValue()
+
+
+
+
+
+ Get a plain attribute (not a relationship).
+
+
+ public
+ getAttributeValue(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getCasts()
+
+
+
+
+
+ Get the casts array.
+
+
+ public
+ getCasts() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getChanges()
+
+
+
+
+
+ Get the attributes that were changed.
+
+
+ public
+ getChanges() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getConnection()
+
+
+
+
+
+ Get the database connection for the model.
+
+
+ public
+ getConnection() : Connection
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getConnectionName()
+
+
+
+
+
+ Get the current connection name for the model.
+
+
+ public
+ getConnectionName() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ getConnectionResolver()
+
+
+
+
+
+ Get the connection resolver instance.
+
+
+ public
+ static getConnectionResolver() : ConnectionResolverInterface
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getCreatedAtColumn()
+
+
+
+
+
+ Get the name of the "created at" column.
+
+
+ public
+ getCreatedAtColumn() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+
+
+ Get the format for database stored dates.
+
+
+ public
+ getDateFormat() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getDates()
+
+
+
+
+
+ Get the attributes that should be converted to dates.
+
+
+ public
+ getDates() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getDirty()
+
+
+
+
+
+ Get the attributes that have been changed since the last sync.
+
+
+ public
+ getDirty() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getEventDispatcher()
+
+
+
+
+
+ Get the event dispatcher instance.
+
+
+ public
+ static getEventDispatcher() : Dispatcher
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getFillable()
+
+
+
+
+
+ Get the fillable attributes for the model.
+
+
+ public
+ getFillable() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getForeignKey()
+
+
+
+
+
+ Get the default foreign key name for the model.
+
+
+ public
+ getForeignKey() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getGlobalScope()
+
+
+
+
+
+ Get a global scope registered with the model.
+
+
+ public
+ static getGlobalScope(Scope|string $scope) : Scope|Closure|null
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : Scope|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Scope|Closure|null
+
+
+
+
+
+ getGlobalScopes()
+
+
+
+
+
+ Get the global scopes for this class instance.
+
+
+ public
+ getGlobalScopes() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getGuarded()
+
+
+
+
+
+ Get the guarded attributes for the model.
+
+
+ public
+ getGuarded() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getHidden()
+
+
+
+
+
+ Get the hidden attributes for the model.
+
+
+ public
+ getHidden() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getIncrementing()
+
+
+
+
+
+ Get the value indicating whether the IDs are incrementing.
+
+
+ public
+ getIncrementing() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getKey()
+
+
+
+
+
+ Get the value of the model's primary key.
+
+
+ public
+ getKey() : mixed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getKeyName()
+
+
+
+
+
+ Get the primary key for the model.
+
+
+ public
+ getKeyName() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getKeyType()
+
+
+
+
+
+ Get the auto-incrementing key type.
+
+
+ public
+ getKeyType() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getMorphClass()
+
+
+
+
+
+ Get the class name for polymorphic relations.
+
+
+ public
+ getMorphClass() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getMutatedAttributes()
+
+
+
+
+
+ Get the mutated attributes for a given instance.
+
+
+ public
+ getMutatedAttributes() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getObservableEvents()
+
+
+
+
+
+ Get the observable event names.
+
+
+ public
+ getObservableEvents() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getOriginal()
+
+
+
+
+
+ Get the model's original attribute values.
+
+
+ public
+ getOriginal([string|null $key = null ][, mixed $default = null ]) : mixed|array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string|null
+ = null
+ -
+
+
+ -
+ $default
+ : mixed
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ mixed|array<string|int, mixed>
+
+
+
+
+
+ getPerPage()
+
+
+
+
+
+ Get the number of models to return per page.
+
+
+ public
+ getPerPage() : int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getQualifiedCreatedAtColumn()
+
+
+
+
+
+ Get the fully qualified "created at" column.
+
+
+ public
+ getQualifiedCreatedAtColumn() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ getQualifiedKeyName()
+
+
+
+
+
+ Get the table qualified key name.
+
+
+ public
+ getQualifiedKeyName() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getQualifiedUpdatedAtColumn()
+
+
+
+
+
+ Get the fully qualified "updated at" column.
+
+
+ public
+ getQualifiedUpdatedAtColumn() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ getQueueableConnection()
+
+
+
+
+
+ Get the queueable connection for the entity.
+
+
+ public
+ getQueueableConnection() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ getQueueableId()
+
+
+
+
+
+ Get the queueable identity for the entity.
+
+
+ public
+ getQueueableId() : mixed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getQueueableRelations()
+
+
+
+
+
+ Get the queueable relationships for the entity.
+
+
+ public
+ getQueueableRelations() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getRawOriginal()
+
+
+
+
+
+ Get the model's raw original attribute values.
+
+
+ public
+ getRawOriginal([string|null $key = null ][, mixed $default = null ]) : mixed|array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string|null
+ = null
+ -
+
+
+ -
+ $default
+ : mixed
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ mixed|array<string|int, mixed>
+
+
+
+
+
+ getRelation()
+
+
+
+
+
+ Get a specified relationship.
+
+
+ public
+ getRelation(string $relation) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getRelations()
+
+
+
+
+
+ Get all the loaded relations for the instance.
+
+
+ public
+ getRelations() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getRelationValue()
+
+
+
+
+
+ Get a relationship.
+
+
+ public
+ getRelationValue(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getRouteKey()
+
+
+
+
+
+ Get the value of the model's route key.
+
+
+ public
+ getRouteKey() : mixed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getRouteKeyName()
+
+
+
+
+
+ Get the route key for the model.
+
+
+ public
+ getRouteKeyName() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getTable()
+
+
+
+
+
+ Get the table associated with the model.
+
+
+ public
+ getTable() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getTouchedRelations()
+
+
+
+
+
+ Get the relationships that are touched on save.
+
+
+ public
+ getTouchedRelations() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getUpdatedAtColumn()
+
+
+
+
+
+ Get the name of the "updated at" column.
+
+
+ public
+ getUpdatedAtColumn() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ getVisible()
+
+
+
+
+
+ Get the visible attributes for the model.
+
+
+ public
+ getVisible() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ guard()
+
+
+
+
+
+ Set the guarded attributes for the model.
+
+
+ public
+ guard(array<string|int, mixed> $guarded) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $guarded
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ handleLazyLoadingViolationUsing()
+
+
+
+
+
+ Register a callback that is responsible for handling lazy loading violations.
+
+
+ public
+ static handleLazyLoadingViolationUsing(callable|null $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : callable|null
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ hasAppended()
+
+
+
+
+
+ Return whether the accessor attribute has been appended.
+
+
+ public
+ hasAppended(string $attribute) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attribute
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasAttributeGetMutator()
+
+
+
+
+
+ Determine if a "Attribute" return type marked get mutator exists for an attribute.
+
+
+ public
+ hasAttributeGetMutator(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasAttributeMutator()
+
+
+
+
+
+ Determine if a "Attribute" return type marked mutator exists for an attribute.
+
+
+ public
+ hasAttributeMutator(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasAttributeSetMutator()
+
+
+
+
+
+ Determine if an "Attribute" return type marked set mutator exists for an attribute.
+
+
+ public
+ hasAttributeSetMutator(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasCast()
+
+
+
+
+
+ Determine whether an attribute should be cast to a native type.
+
+
+ public
+ hasCast(string $key[, array<string|int, mixed>|string|null $types = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $types
+ : array<string|int, mixed>|string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasGetMutator()
+
+
+
+
+
+ Determine if a get mutator exists for an attribute.
+
+
+ public
+ hasGetMutator(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasGlobalScope()
+
+
+
+
+
+ Determine if a model has a global scope.
+
+
+ public
+ static hasGlobalScope(Scope|string $scope) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : Scope|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasMany()
+
+
+
+
+
+ Define a one-to-many relationship.
+
+
+ public
+ hasMany(string $related[, string|null $foreignKey = null ][, string|null $localKey = null ]) : HasMany
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $foreignKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasManyThrough()
+
+
+
+
+
+ Define a has-many-through relationship.
+
+
+ public
+ hasManyThrough(string $related, string $through[, string|null $firstKey = null ][, string|null $secondKey = null ][, string|null $localKey = null ][, string|null $secondLocalKey = null ]) : HasManyThrough
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $through
+ : string
+
+ -
+
+
+ -
+ $firstKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $secondKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $secondLocalKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasNamedScope()
+
+
+
+
+
+ Determine if the model has a given scope.
+
+
+ public
+ hasNamedScope(string $scope) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasOne()
+
+
+
+
+
+ Define a one-to-one relationship.
+
+
+ public
+ hasOne(string $related[, string|null $foreignKey = null ][, string|null $localKey = null ]) : HasOne
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $foreignKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasOneThrough()
+
+
+
+
+
+ Define a has-one-through relationship.
+
+
+ public
+ hasOneThrough(string $related, string $through[, string|null $firstKey = null ][, string|null $secondKey = null ][, string|null $localKey = null ][, string|null $secondLocalKey = null ]) : HasOneThrough
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $through
+ : string
+
+ -
+
+
+ -
+ $firstKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $secondKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $secondLocalKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasSetMutator()
+
+
+
+
+
+ Determine if a set mutator exists for an attribute.
+
+
+ public
+ hasSetMutator(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ is()
+
+
+
+
+
+ Determine if two models have the same ID and belong to the same table.
+
+
+ public
+ is(Model|null $model) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $model
+ : Model|null
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isClean()
+
+
+
+
+
+ Determine if the model or all the given attribute(s) have remained the same.
+
+
+ public
+ isClean([array<string|int, mixed>|string|null $attributes = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDirty()
+
+
+
+
+
+ Determine if the model or any of the given attribute(s) have been modified.
+
+
+ public
+ isDirty([array<string|int, mixed>|string|null $attributes = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isFillable()
+
+
+
+
+
+ Determine if the given attribute may be mass assigned.
+
+
+ public
+ isFillable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isGuarded()
+
+
+
+
+
+ Determine if the given key is guarded.
+
+
+ public
+ isGuarded(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isIgnoringTouch()
+
+
+
+
+
+ Determine if the given model is ignoring touches.
+
+
+ public
+ static isIgnoringTouch([string|null $class = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isNot()
+
+
+
+
+
+ Determine if two models are not the same.
+
+
+ public
+ isNot(Model|null $model) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $model
+ : Model|null
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isRelation()
+
+
+
+
+
+ Determine if the given key is a relationship method on the model.
+
+
+ public
+ isRelation(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isUnguarded()
+
+
+
+
+
+ Determine if the current state is "unguarded".
+
+
+ public
+ static isUnguarded() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ joiningTable()
+
+
+
+
+
+ Get the joining table name for a many-to-many relation.
+
+
+ public
+ joiningTable(string $related[, Model|null $instance = null ]) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $instance
+ : Model|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ joiningTableSegment()
+
+
+
+
+
+ Get this model's half of the intermediate table name for belongsToMany relationships.
+
+
+ public
+ joiningTableSegment() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ jsonSerialize()
+
+
+
+
+
+ Convert the object into something JSON serializable.
+
+
+ public
+ jsonSerialize() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+ #[ReturnTypeWillChange]
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ load()
+
+
+
+
+
+ Eager load relations on the model.
+
+
+ public
+ load(array<string|int, mixed>|string $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadAggregate()
+
+
+
+
+
+ Eager load relation's column aggregations on the model.
+
+
+ public
+ loadAggregate(array<string|int, mixed>|string $relations, string $column[, string $function = null ]) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+ -
+ $function
+ : string
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadAvg()
+
+
+
+
+
+ Eager load relation average column values on the model.
+
+
+ public
+ loadAvg(array<string|int, mixed>|string $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadCount()
+
+
+
+
+
+ Eager load relation counts on the model.
+
+
+ public
+ loadCount(array<string|int, mixed>|string $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadExists()
+
+
+
+
+
+ Eager load related model existence values on the model.
+
+
+ public
+ loadExists(array<string|int, mixed>|string $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMax()
+
+
+
+
+
+ Eager load relation max column values on the model.
+
+
+ public
+ loadMax(array<string|int, mixed>|string $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMin()
+
+
+
+
+
+ Eager load relation min column values on the model.
+
+
+ public
+ loadMin(array<string|int, mixed>|string $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMissing()
+
+
+
+
+
+ Eager load relations on the model if they are not already eager loaded.
+
+
+ public
+ loadMissing(array<string|int, mixed>|string $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorph()
+
+
+
+
+
+ Eager load relationships on the polymorphic relation of a model.
+
+
+ public
+ loadMorph(string $relation, array<string|int, mixed> $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphAggregate()
+
+
+
+
+
+ Eager load relationship column aggregation on the polymorphic relation of a model.
+
+
+ public
+ loadMorphAggregate(string $relation, array<string|int, mixed> $relations, string $column[, string $function = null ]) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+ -
+ $function
+ : string
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphAvg()
+
+
+
+
+
+ Eager load relationship average column values on the polymorphic relation of a model.
+
+
+ public
+ loadMorphAvg(string $relation, array<string|int, mixed> $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphCount()
+
+
+
+
+
+ Eager load relationship counts on the polymorphic relation of a model.
+
+
+ public
+ loadMorphCount(string $relation, array<string|int, mixed> $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphMax()
+
+
+
+
+
+ Eager load relationship max column values on the polymorphic relation of a model.
+
+
+ public
+ loadMorphMax(string $relation, array<string|int, mixed> $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphMin()
+
+
+
+
+
+ Eager load relationship min column values on the polymorphic relation of a model.
+
+
+ public
+ loadMorphMin(string $relation, array<string|int, mixed> $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadMorphSum()
+
+
+
+
+
+ Eager load relationship column summations on the polymorphic relation of a model.
+
+
+ public
+ loadMorphSum(string $relation, array<string|int, mixed> $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ loadSum()
+
+
+
+
+
+ Eager load relation's column summations on the model.
+
+
+ public
+ loadSum(array<string|int, mixed>|string $relations, string $column) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ makeHidden()
+
+
+
+
+
+ Make the given, typically visible, attributes hidden.
+
+
+ public
+ makeHidden(array<string|int, mixed>|string|null $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ makeHiddenIf()
+
+
+
+
+
+ Make the given, typically visible, attributes hidden if the given truth test passes.
+
+
+ public
+ makeHiddenIf(bool|Closure $condition, array<string|int, mixed>|string|null $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $condition
+ : bool|Closure
+
+ -
+
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ makeVisible()
+
+
+
+
+
+ Make the given, typically hidden, attributes visible.
+
+
+ public
+ makeVisible(array<string|int, mixed>|string|null $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ makeVisibleIf()
+
+
+
+
+
+ Make the given, typically hidden, attributes visible if the given truth test passes.
+
+
+ public
+ makeVisibleIf(bool|Closure $condition, array<string|int, mixed>|string|null $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $condition
+ : bool|Closure
+
+ -
+
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ mergeCasts()
+
+
+
+
+
+ Merge new casts with existing casts on the model.
+
+
+ public
+ mergeCasts(array<string|int, mixed> $casts) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $casts
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ mergeFillable()
+
+
+
+
+
+ Merge new fillable attributes with existing fillable attributes on the model.
+
+
+ public
+ mergeFillable(array<string|int, mixed> $fillable) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $fillable
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ mergeGuarded()
+
+
+
+
+
+ Merge new guarded attributes with existing guarded attributes on the model.
+
+
+ public
+ mergeGuarded(array<string|int, mixed> $guarded) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $guarded
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ morphedByMany()
+
+
+
+
+
+ Define a polymorphic, inverse many-to-many relationship.
+
+
+ public
+ morphedByMany(string $related, string $name[, string|null $table = null ][, string|null $foreignPivotKey = null ][, string|null $relatedPivotKey = null ][, string|null $parentKey = null ][, string|null $relatedKey = null ]) : MorphToMany
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $table
+ : string|null
+ = null
+ -
+
+
+ -
+ $foreignPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $parentKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphMany()
+
+
+
+
+
+ Define a polymorphic one-to-many relationship.
+
+
+ public
+ morphMany(string $related, string $name[, string|null $type = null ][, string|null $id = null ][, string|null $localKey = null ]) : MorphMany
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $type
+ : string|null
+ = null
+ -
+
+
+ -
+ $id
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphOne()
+
+
+
+
+
+ Define a polymorphic one-to-one relationship.
+
+
+ public
+ morphOne(string $related, string $name[, string|null $type = null ][, string|null $id = null ][, string|null $localKey = null ]) : MorphOne
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $type
+ : string|null
+ = null
+ -
+
+
+ -
+ $id
+ : string|null
+ = null
+ -
+
+
+ -
+ $localKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphTo()
+
+
+
+
+
+ Define a polymorphic, inverse one-to-one or many relationship.
+
+
+ public
+ morphTo([string|null $name = null ][, string|null $type = null ][, string|null $id = null ][, string|null $ownerKey = null ]) : MorphTo
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string|null
+ = null
+ -
+
+
+ -
+ $type
+ : string|null
+ = null
+ -
+
+
+ -
+ $id
+ : string|null
+ = null
+ -
+
+
+ -
+ $ownerKey
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphToMany()
+
+
+
+
+
+ Define a polymorphic many-to-many relationship.
+
+
+ public
+ morphToMany(string $related, string $name[, string|null $table = null ][, string|null $foreignPivotKey = null ][, string|null $relatedPivotKey = null ][, string|null $parentKey = null ][, string|null $relatedKey = null ][, bool $inverse = false ]) : MorphToMany
+
+
+
+
+
+ Parameters
+
+ -
+ $related
+ : string
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $table
+ : string|null
+ = null
+ -
+
+
+ -
+ $foreignPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedPivotKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $parentKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $relatedKey
+ : string|null
+ = null
+ -
+
+
+ -
+ $inverse
+ : bool
+ = false
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newCollection()
+
+
+
+
+
+ Create a new Eloquent Collection instance.
+
+
+ public
+ newCollection([array<string|int, mixed> $models = [] ]) : Collection
+
+
+
+
+
+ Parameters
+
+ -
+ $models
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newEloquentBuilder()
+
+
+
+
+
+ Create a new Eloquent query builder for the model.
+
+
+ public
+ newEloquentBuilder(Builder $query) : Builder|static
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newFromBuilder()
+
+
+
+
+
+ Create a new model instance that is existing.
+
+
+ public
+ newFromBuilder([array<string|int, mixed> $attributes = [] ][, string|null $connection = null ]) : static
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+ -
+ $connection
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ static
+
+
+
+
+
+ newInstance()
+
+
+
+
+
+ Create a new instance of the given model.
+
+
+ public
+ newInstance([array<string|int, mixed> $attributes = [] ][, bool $exists = false ]) : static
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+ -
+ $exists
+ : bool
+ = false
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ static
+
+
+
+
+
+ newModelQuery()
+
+
+
+
+
+ Get a new query builder that doesn't have any global scopes or eager loading.
+
+
+ public
+ newModelQuery() : Builder|static
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newPivot()
+
+
+
+
+
+ Create a new pivot model instance.
+
+
+ public
+ newPivot(Model $parent, array<string|int, mixed> $attributes, string $table, bool $exists[, string|null $using = null ]) : Pivot
+
+
+
+
+
+ Parameters
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $table
+ : string
+
+ -
+
+
+ -
+ $exists
+ : bool
+
+ -
+
+
+ -
+ $using
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Pivot
+
+
+
+
+
+ newQuery()
+
+
+
+
+
+ Get a new query builder for the model's table.
+
+
+ public
+ newQuery() : Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newQueryForRestoration()
+
+
+
+
+
+ Get a new query to restore one or more models by their queueable IDs.
+
+
+ public
+ newQueryForRestoration(array<string|int, mixed>|int $ids) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $ids
+ : array<string|int, mixed>|int
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newQueryWithoutRelationships()
+
+
+
+
+
+ Get a new query builder with no relationships loaded.
+
+
+ public
+ newQueryWithoutRelationships() : Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newQueryWithoutScope()
+
+
+
+
+
+ Get a new query instance without a given scope.
+
+
+ public
+ newQueryWithoutScope(Scope|string $scope) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $scope
+ : Scope|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newQueryWithoutScopes()
+
+
+
+
+
+ Get a new query builder that doesn't have any global scopes.
+
+
+ public
+ newQueryWithoutScopes() : Builder|static
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ observe()
+
+
+
+
+
+ Register observers with the model.
+
+
+ public
+ static observe(object|array<string|int, mixed>|string $classes) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $classes
+ : object|array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ RuntimeException
+
+
+
+
+
+
+
+
+
+
+
+ offsetExists()
+
+
+
+
+
+ Determine if the given attribute exists.
+
+
+ public
+ offsetExists(mixed $offset) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $offset
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+ -
+ #[ReturnTypeWillChange]
+
+
+
+
+
+
+
+
+
+ offsetGet()
+
+
+
+
+
+ Get the value for a given offset.
+
+
+ public
+ offsetGet(mixed $offset) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $offset
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+ -
+ #[ReturnTypeWillChange]
+
+
+
+
+
+
+
+
+ offsetSet()
+
+
+
+
+
+ Set the value for a given offset.
+
+
+ public
+ offsetSet(mixed $offset, mixed $value) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $offset
+ : mixed
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+ -
+ #[ReturnTypeWillChange]
+
+
+
+
+
+
+
+
+ offsetUnset()
+
+
+
+
+
+ Unset the value for a given offset.
+
+
+ public
+ offsetUnset(mixed $offset) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $offset
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+ -
+ #[ReturnTypeWillChange]
+
+
+
+
+
+
+
+
+ on()
+
+
+
+
+
+ Begin querying the model on a given connection.
+
+
+ public
+ static on([string|null $connection = null ]) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $connection
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ only()
+
+
+
+
+
+ Get a subset of the model's attributes.
+
+
+ public
+ only(array<string|int, mixed>|mixed $attributes) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ onWriteConnection()
+
+
+
+
+
+ Begin querying the model on the write connection.
+
+
+ public
+ static onWriteConnection() : Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ originalIsEquivalent()
+
+
+
+
+
+ Determine if the new and old values for a given key are equivalent.
+
+
+ public
+ originalIsEquivalent(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ preventLazyLoading()
+
+
+
+
+
+ Prevent model relationships from being lazy loaded.
+
+
+ public
+ static preventLazyLoading([bool $value = true ]) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : bool
+ = true
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ preventsLazyLoading()
+
+
+
+
+
+ Determine if lazy loading is disabled.
+
+
+ public
+ static preventsLazyLoading() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ push()
+
+
+
+
+
+ Save the model and all of its relationships.
+
+
+ public
+ push() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ qualifyColumn()
+
+
+
+
+
+ Qualify the given column name by the model's table.
+
+
+ public
+ qualifyColumn(string $column) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $column
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ qualifyColumns()
+
+
+
+
+
+ Qualify the given columns with the model's table.
+
+
+ public
+ qualifyColumns(array<string|int, mixed> $columns) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $columns
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ query()
+
+
+
+
+
+ Begin querying the model.
+
+
+ public
+ static query() : Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ refresh()
+
+
+
+
+
+ Reload the current model instance with fresh attributes from the database.
+
+
+ public
+ refresh() : $this
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ registerGlobalScopes()
+
+
+
+
+
+ Register the global scopes for this builder instance.
+
+
+ public
+ registerGlobalScopes(Builder $builder) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $builder
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ reguard()
+
+
+
+
+
+ Enable the mass assignment restrictions.
+
+
+ public
+ static reguard() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ relationLoaded()
+
+
+
+
+
+ Determine if the given relation is loaded.
+
+
+ public
+ relationLoaded(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ relationsToArray()
+
+
+
+
+
+ Get the model's relationships in array form.
+
+
+ public
+ relationsToArray() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ removeObservableEvents()
+
+
+
+
+
+ Remove an observable event name.
+
+
+ public
+ removeObservableEvents(array<string|int, mixed>|mixed $observables) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $observables
+ : array<string|int, mixed>|mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ replicate()
+
+
+
+
+
+ Clone the model into a new, non-existing instance.
+
+
+ public
+ replicate([array<string|int, mixed>|null $except = null ]) : static
+
+
+
+
+
+ Parameters
+
+ -
+ $except
+ : array<string|int, mixed>|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ static
+
+
+
+
+
+ replicating()
+
+
+
+
+
+ Register a replicating model event with the dispatcher.
+
+
+ public
+ static replicating(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveChildRouteBinding()
+
+
+
+
+
+ Retrieve the child model for a bound value.
+
+
+ public
+ resolveChildRouteBinding(string $childType, mixed $value, string|null $field) : Model|null
+
+
+
+
+
+ Parameters
+
+ -
+ $childType
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Model|null
+
+
+
+
+
+ resolveConnection()
+
+
+
+
+
+ Resolve a connection instance.
+
+
+ public
+ static resolveConnection([string|null $connection = null ]) : Connection
+
+
+
+
+
+ Parameters
+
+ -
+ $connection
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveRelationUsing()
+
+
+
+
+
+ Define a dynamic relation resolver.
+
+
+ public
+ static resolveRelationUsing(string $name, Closure $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $callback
+ : Closure
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveRouteBinding()
+
+
+
+
+
+ Retrieve the model for a bound value.
+
+
+ public
+ resolveRouteBinding(mixed $value[, string|null $field = null ]) : Model|null
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Model|null
+
+
+
+
+
+ resolveRouteBindingQuery()
+
+
+
+
+
+ Retrieve the model for a bound value.
+
+
+ public
+ resolveRouteBindingQuery(Model|Relation $query, mixed $value[, string|null $field = null ]) : Relation
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Model|Relation
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveSoftDeletableChildRouteBinding()
+
+
+
+
+
+ Retrieve the child model for a bound value.
+
+
+ public
+ resolveSoftDeletableChildRouteBinding(string $childType, mixed $value, string|null $field) : Model|null
+
+
+
+
+
+ Parameters
+
+ -
+ $childType
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Model|null
+
+
+
+
+
+ resolveSoftDeletableRouteBinding()
+
+
+
+
+
+ Retrieve the model for a bound value.
+
+
+ public
+ resolveSoftDeletableRouteBinding(mixed $value[, string|null $field = null ]) : Model|null
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ Model|null
+
+
+
+
+
+ retrieved()
+
+
+
+
+
+ Register a retrieved model event with the dispatcher.
+
+
+ public
+ static retrieved(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ save()
+
+
+
+
+
+ Save the model to the database.
+
+
+ public
+ save([array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ saved()
+
+
+
+
+
+ Register a saved model event with the dispatcher.
+
+
+ public
+ static saved(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ saveOrFail()
+
+
+
+
+
+ Save the model to the database within a transaction.
+
+
+ public
+ saveOrFail([array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ Throwable
+
+
+
+
+
+
+
+
+
+
+
+
+ saveQuietly()
+
+
+
+
+
+ Save the model to the database without raising any events.
+
+
+ public
+ saveQuietly([array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ saving()
+
+
+
+
+
+ Register a saving model event with the dispatcher.
+
+
+ public
+ static saving(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setAppends()
+
+
+
+
+
+ Set the accessors to append to model arrays.
+
+
+ public
+ setAppends(array<string|int, mixed> $appends) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $appends
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setAttribute()
+
+
+
+
+
+ Set a given attribute on the model.
+
+
+ public
+ setAttribute(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setConnection()
+
+
+
+
+
+ Set the connection associated with the model.
+
+
+ public
+ setConnection(string|null $name) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string|null
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setConnectionResolver()
+
+
+
+
+
+ Set the connection resolver instance.
+
+
+ public
+ static setConnectionResolver(ConnectionResolverInterface $resolver) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $resolver
+ : ConnectionResolverInterface
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setCreatedAt()
+
+
+
+
+
+ Set the value of the "created at" attribute.
+
+
+ public
+ setCreatedAt(mixed $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+
+
+ Set the date format used by the model.
+
+
+ public
+ setDateFormat(string $format) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $format
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setEventDispatcher()
+
+
+
+
+
+ Set the event dispatcher instance.
+
+
+ public
+ static setEventDispatcher(Dispatcher $dispatcher) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $dispatcher
+ : Dispatcher
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setHidden()
+
+
+
+
+
+ Set the hidden attributes for the model.
+
+
+ public
+ setHidden(array<string|int, mixed> $hidden) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $hidden
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setIncrementing()
+
+
+
+
+
+ Set whether IDs are incrementing.
+
+
+ public
+ setIncrementing(bool $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : bool
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setKeyName()
+
+
+
+
+
+ Set the primary key for the model.
+
+
+ public
+ setKeyName(string $key) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setKeyType()
+
+
+
+
+
+ Set the data type for the primary key.
+
+
+ public
+ setKeyType(string $type) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $type
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setObservableEvents()
+
+
+
+
+
+ Set the observable event names.
+
+
+ public
+ setObservableEvents(array<string|int, mixed> $observables) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $observables
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setPerPage()
+
+
+
+
+
+ Set the number of models to return per page.
+
+
+ public
+ setPerPage(int $perPage) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $perPage
+ : int
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setRawAttributes()
+
+
+
+
+
+ Set the array of model attributes. No checking is done.
+
+
+ public
+ setRawAttributes(array<string|int, mixed> $attributes[, bool $sync = false ]) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $sync
+ : bool
+ = false
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setRelation()
+
+
+
+
+
+ Set the given relationship on the model.
+
+
+ public
+ setRelation(string $relation, mixed $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setRelations()
+
+
+
+
+
+ Set the entire relations array on the model.
+
+
+ public
+ setRelations(array<string|int, mixed> $relations) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setTable()
+
+
+
+
+
+ Set the table associated with the model.
+
+
+ public
+ setTable(string $table) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $table
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setTouchedRelations()
+
+
+
+
+
+ Set the relationships that are touched on save.
+
+
+ public
+ setTouchedRelations(array<string|int, mixed> $touches) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $touches
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setUpdatedAt()
+
+
+
+
+
+ Set the value of the "updated at" attribute.
+
+
+ public
+ setUpdatedAt(mixed $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ setVisible()
+
+
+
+
+
+ Set the visible attributes for the model.
+
+
+ public
+ setVisible(array<string|int, mixed> $visible) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $visible
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ syncChanges()
+
+
+
+
+
+ Sync the changed attributes.
+
+
+ public
+ syncChanges() : $this
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ syncOriginal()
+
+
+
+
+
+ Sync the original attributes with the current.
+
+
+ public
+ syncOriginal() : $this
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ syncOriginalAttribute()
+
+
+
+
+
+ Sync a single original attribute with its current value.
+
+
+ public
+ syncOriginalAttribute(string $attribute) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attribute
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ syncOriginalAttributes()
+
+
+
+
+
+ Sync multiple original attribute with their current values.
+
+
+ public
+ syncOriginalAttributes(array<string|int, mixed>|string $attributes) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ toArray()
+
+
+
+
+
+ Convert the model instance to an array.
+
+
+ public
+ toArray() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ toJson()
+
+
+
+
+
+ Convert the model instance to JSON.
+
+
+ public
+ toJson([int $options = 0 ]) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $options
+ : int
+ = 0
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ JsonEncodingException
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ totallyGuarded()
+
+
+
+
+
+ Determine if the model is totally guarded.
+
+
+ public
+ totallyGuarded() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ touch()
+
+
+
+
+
+ Update the model's update timestamp.
+
+
+ public
+ touch() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ touches()
+
+
+
+
+
+ Determine if the model touches a given relation.
+
+
+ public
+ touches(string $relation) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ touchOwners()
+
+
+
+
+
+ Touch the owning relations of the model.
+
+
+ public
+ touchOwners() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ unguard()
+
+
+
+
+
+ Disable all mass assignable restrictions.
+
+
+ public
+ static unguard([bool $state = true ]) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $state
+ : bool
+ = true
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ unguarded()
+
+
+
+
+
+ Run the given callable while being unguarded.
+
+
+ public
+ static unguarded(callable $callback) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : callable
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ unsetConnectionResolver()
+
+
+
+
+
+ Unset the connection resolver for models.
+
+
+ public
+ static unsetConnectionResolver() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ unsetEventDispatcher()
+
+
+
+
+
+ Unset the event dispatcher for models.
+
+
+ public
+ static unsetEventDispatcher() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ unsetRelation()
+
+
+
+
+
+ Unset a loaded relationship.
+
+
+ public
+ unsetRelation(string $relation) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $relation
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ unsetRelations()
+
+
+
+
+
+ Unset all the loaded relations for the instance.
+
+
+ public
+ unsetRelations() : $this
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ update()
+
+
+
+
+
+ Update the model in the database.
+
+
+ public
+ update([array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ updated()
+
+
+
+
+
+ Register an updated model event with the dispatcher.
+
+
+ public
+ static updated(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ updateOrFail()
+
+
+
+
+
+ Update the model in the database within a transaction.
+
+
+ public
+ updateOrFail([array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ Throwable
+
+
+
+
+
+
+
+
+
+
+
+
+ updateQuietly()
+
+
+
+
+
+ Update the model in the database without raising any events.
+
+
+ public
+ updateQuietly([array<string|int, mixed> $attributes = [] ][, array<string|int, mixed> $options = [] ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+ = []
+ -
+
+
+ -
+ $options
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ updateTimestamps()
+
+
+
+
+
+ Update the creation and update timestamps.
+
+
+ public
+ updateTimestamps() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ updating()
+
+
+
+
+
+ Register an updating model event with the dispatcher.
+
+
+ public
+ static updating(QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ usesTimestamps()
+
+
+
+
+
+ Determine if the model uses timestamps.
+
+
+ public
+ usesTimestamps() : bool
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ wasChanged()
+
+
+
+
+
+ Determine if the model or any of the given attribute(s) have been modified.
+
+
+ public
+ wasChanged([array<string|int, mixed>|string|null $attributes = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ with()
+
+
+
+
+
+ Begin querying a model with eager loading.
+
+
+ public
+ static with(array<string|int, mixed>|string $relations) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $relations
+ : array<string|int, mixed>|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ withoutBroadcasting()
+
+
+
+
+
+ Execute a callback without broadcasting any model events for all model types.
+
+
+ public
+ static withoutBroadcasting(callable $callback) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : callable
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ withoutEvents()
+
+
+
+
+
+ Execute a callback without firing any model events for any model type.
+
+
+ public
+ static withoutEvents(callable $callback) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : callable
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ withoutRelations()
+
+
+
+
+
+ Duplicate the instance and unset all the loaded relations.
+
+
+ public
+ withoutRelations() : $this
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ withoutTouching()
+
+
+
+
+
+ Disables relationship model touching for the current class during given callback scope.
+
+
+ public
+ static withoutTouching(callable $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $callback
+ : callable
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ withoutTouchingOn()
+
+
+
+
+
+ Disables relationship model touching for the given model classes during given callback scope.
+
+
+ public
+ static withoutTouchingOn(array<string|int, mixed> $models, callable $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $models
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $callback
+ : callable
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ addCastAttributesToArray()
+
+
+
+
+
+ Add the casted attributes to the attributes array.
+
+
+ protected
+ addCastAttributesToArray(array<string|int, mixed> $attributes, array<string|int, mixed> $mutatedAttributes) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $mutatedAttributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ addDateAttributesToArray()
+
+
+
+
+
+ Add the date attributes to the attributes array.
+
+
+ protected
+ addDateAttributesToArray(array<string|int, mixed> $attributes) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ addMutatedAttributesToArray()
+
+
+
+
+
+ Add the mutated attributes to the attributes array.
+
+
+ protected
+ addMutatedAttributesToArray(array<string|int, mixed> $attributes, array<string|int, mixed> $mutatedAttributes) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $mutatedAttributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ asDate()
+
+
+
+
+
+ Return a timestamp as DateTime object with time set to 00:00:00.
+
+
+ protected
+ asDate(mixed $value) : Carbon
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ asDateTime()
+
+
+
+
+
+ Return a timestamp as DateTime object.
+
+
+ protected
+ asDateTime(mixed $value) : Carbon
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ asDecimal()
+
+
+
+
+
+ Return a decimal as string.
+
+
+ protected
+ asDecimal(float $value, int $decimals) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : float
+
+ -
+
+
+ -
+ $decimals
+ : int
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ asJson()
+
+
+
+
+
+ Encode the given value as JSON.
+
+
+ protected
+ asJson(mixed $value) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ asTimestamp()
+
+
+
+
+
+ Return a timestamp as unix timestamp.
+
+
+ protected
+ asTimestamp(mixed $value) : int
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ boot()
+
+
+
+
+
+ Bootstrap the model and its traits.
+
+
+ protected
+ static boot() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ booted()
+
+
+
+
+
+ Perform any actions required after the model boots.
+
+
+ protected
+ static booted() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ bootIfNotBooted()
+
+
+
+
+
+ Check if the model needs to be booted and if so, do it.
+
+
+ protected
+ bootIfNotBooted() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ booting()
+
+
+
+
+
+ Perform any actions required before the model boots.
+
+
+ protected
+ static booting() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ bootTraits()
+
+
+
+
+
+ Boot all of the bootable traits on the model.
+
+
+ protected
+ static bootTraits() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ castAttribute()
+
+
+
+
+
+ Cast an attribute to a native PHP type.
+
+
+ protected
+ castAttribute(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ castAttributeAsEncryptedString()
+
+
+
+
+
+ Cast the given attribute to an encrypted string.
+
+
+ protected
+ castAttributeAsEncryptedString(string $key, mixed $value) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ castAttributeAsJson()
+
+
+
+
+
+ Cast the given attribute to JSON.
+
+
+ protected
+ castAttributeAsJson(string $key, mixed $value) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ decrement()
+
+
+
+
+
+ Decrement a column's value by a given amount.
+
+
+ protected
+ decrement(string $column[, float|int $amount = 1 ][, array<string|int, mixed> $extra = [] ]) : int
+
+
+
+
+
+ Parameters
+
+ -
+ $column
+ : string
+
+ -
+
+
+ -
+ $amount
+ : float|int
+ = 1
+ -
+
+
+ -
+ $extra
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ deviateClassCastableAttribute()
+
+
+
+
+
+ Increment or decrement the given attribute using the custom cast class.
+
+
+ protected
+ deviateClassCastableAttribute(string $method, string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $method
+ : string
+
+ -
+
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ fillableFromArray()
+
+
+
+
+
+ Get the fillable attributes of a given array.
+
+
+ protected
+ fillableFromArray(array<string|int, mixed> $attributes) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ filterModelEventResults()
+
+
+
+
+
+ Filter the model event results.
+
+
+ protected
+ filterModelEventResults(mixed $result) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $result
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ finishSave()
+
+
+
+
+
+ Perform any actions that are necessary after the model is saved.
+
+
+ protected
+ finishSave(array<string|int, mixed> $options) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $options
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ fireCustomModelEvent()
+
+
+
+
+
+ Fire a custom model event for the given event.
+
+
+ protected
+ fireCustomModelEvent(string $event, string $method) : mixed|null
+
+
+
+
+
+ Parameters
+
+ -
+ $event
+ : string
+
+ -
+
+
+ -
+ $method
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ mixed|null
+
+
+
+
+
+ fireModelEvent()
+
+
+
+
+
+ Fire the given event for the model.
+
+
+ protected
+ fireModelEvent(string $event[, bool $halt = true ]) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $event
+ : string
+
+ -
+
+
+ -
+ $halt
+ : bool
+ = true
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ forwardCallTo()
+
+
+
+
+
+ Forward a method call to the given object.
+
+
+ protected
+ forwardCallTo(mixed $object, string $method, array<string|int, mixed> $parameters) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $object
+ : mixed
+
+ -
+
+
+ -
+ $method
+ : string
+
+ -
+
+
+ -
+ $parameters
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ BadMethodCallException
+
+
+
+
+
+
+
+
+
+
+
+ forwardDecoratedCallTo()
+
+
+
+
+
+ Forward a method call to the given object, returning $this if the forwarded call returned itself.
+
+
+ protected
+ forwardDecoratedCallTo(mixed $object, string $method, array<string|int, mixed> $parameters) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $object
+ : mixed
+
+ -
+
+
+ -
+ $method
+ : string
+
+ -
+
+
+ -
+ $parameters
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ BadMethodCallException
+
+
+
+
+
+
+
+
+
+
+
+ getArrayableAppends()
+
+
+
+
+
+ Get all of the appendable values that are arrayable.
+
+
+ protected
+ getArrayableAppends() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getArrayableAttributes()
+
+
+
+
+
+ Get an attribute array of all arrayable attributes.
+
+
+ protected
+ getArrayableAttributes() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getArrayableItems()
+
+
+
+
+
+ Get an attribute array of all arrayable values.
+
+
+ protected
+ getArrayableItems(array<string|int, mixed> $values) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $values
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getArrayableRelations()
+
+
+
+
+
+ Get an attribute array of all arrayable relations.
+
+
+ protected
+ getArrayableRelations() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getArrayAttributeByKey()
+
+
+
+
+
+ Get an array attribute or return an empty array if it is not set.
+
+
+ protected
+ getArrayAttributeByKey(string $key) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getArrayAttributeWithValue()
+
+
+
+
+
+ Get an array attribute with the given key and value set.
+
+
+ protected
+ getArrayAttributeWithValue(string $path, string $key, mixed $value) : $this
+
+
+
+
+
+ Parameters
+
+ -
+ $path
+ : string
+
+ -
+
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ $this
+
+
+
+
+
+ getAttributeFromArray()
+
+
+
+
+
+ Get an attribute from the $attributes array.
+
+
+ protected
+ getAttributeFromArray(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getAttributeMarkedMutatorMethods()
+
+
+
+
+
+ Get all of the "Attribute" return typed attribute mutator methods.
+
+
+ protected
+ static getAttributeMarkedMutatorMethods(mixed $class) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getAttributesForInsert()
+
+
+
+
+
+ Get all of the current attributes on the model for an insert operation.
+
+
+ protected
+ getAttributesForInsert() : array<string|int, mixed>
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getCastType()
+
+
+
+
+
+ Get the type of cast for a model attribute.
+
+
+ protected
+ getCastType(string $key) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ getClassCastableAttributeValue()
+
+
+
+
+
+ Cast the given attribute using a custom cast class.
+
+
+ protected
+ getClassCastableAttributeValue(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getEnumCastableAttributeValue()
+
+
+
+
+
+ Cast the given attribute to an enum.
+
+
+ protected
+ getEnumCastableAttributeValue(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ getKeyForSaveQuery()
+
+
+
+
+
+ Get the primary key value for a save query.
+
+
+ protected
+ getKeyForSaveQuery() : mixed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getKeyForSelectQuery()
+
+
+
+
+
+ Get the primary key value for a select query.
+
+
+ protected
+ getKeyForSelectQuery() : mixed
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getMorphs()
+
+
+
+
+
+ Get the polymorphic relationship columns.
+
+
+ protected
+ getMorphs(string $name, string $type, string $id) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $id
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getMutatorMethods()
+
+
+
+
+
+ Get all of the attribute mutator methods.
+
+
+ protected
+ static getMutatorMethods(mixed $class) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ getOriginalWithoutRewindingModel()
+
+
+
+
+
+ Get the model's original attribute values.
+
+
+ protected
+ getOriginalWithoutRewindingModel([string|null $key = null ][, mixed $default = null ]) : mixed|array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string|null
+ = null
+ -
+
+
+ -
+ $default
+ : mixed
+ = null
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ mixed|array<string|int, mixed>
+
+
+
+
+
+ getRelationshipFromMethod()
+
+
+
+
+
+ Get a relationship value from a method.
+
+
+ protected
+ getRelationshipFromMethod(string $method) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $method
+ : string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ LogicException
+
+
+
+
+
+
+
+
+
+
+
+ guessBelongsToManyRelation()
+
+
+
+
+
+ Get the relationship name of the belongsToMany relationship.
+
+
+ protected
+ guessBelongsToManyRelation() : string|null
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string|null
+
+
+
+
+
+ guessBelongsToRelation()
+
+
+
+
+
+ Guess the "belongs to" relationship name.
+
+
+ protected
+ guessBelongsToRelation() : string
+
+
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ handleLazyLoadingViolation()
+
+
+
+
+
+ Handle a lazy loading violation.
+
+
+ protected
+ handleLazyLoadingViolation(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ hasChanges()
+
+
+
+
+
+ Determine if any of the given attributes were changed.
+
+
+ protected
+ hasChanges(array<string|int, mixed> $changes[, array<string|int, mixed>|string|null $attributes = null ]) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $changes
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $attributes
+ : array<string|int, mixed>|string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ increment()
+
+
+
+
+
+ Increment a column's value by a given amount.
+
+
+ protected
+ increment(string $column[, float|int $amount = 1 ][, array<string|int, mixed> $extra = [] ]) : int
+
+
+
+
+
+ Parameters
+
+ -
+ $column
+ : string
+
+ -
+
+
+ -
+ $amount
+ : float|int
+ = 1
+ -
+
+
+ -
+ $extra
+ : array<string|int, mixed>
+ = []
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ incrementOrDecrement()
+
+
+
+
+
+ Run the increment or decrement method on the model.
+
+
+ protected
+ incrementOrDecrement(string $column, float|int $amount, array<string|int, mixed> $extra, string $method) : int
+
+
+
+
+
+ Parameters
+
+ -
+ $column
+ : string
+
+ -
+
+
+ -
+ $amount
+ : float|int
+
+ -
+
+
+ -
+ $extra
+ : array<string|int, mixed>
+
+ -
+
+
+ -
+ $method
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ initializeTraits()
+
+
+
+
+
+ Initialize any initializable traits on the model.
+
+
+ protected
+ initializeTraits() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ insertAndSetId()
+
+
+
+
+
+ Insert the given attributes and set the ID on the model.
+
+
+ protected
+ insertAndSetId(Builder $query, array<string|int, mixed> $attributes) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $attributes
+ : array<string|int, mixed>
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ isClassCastable()
+
+
+
+
+
+ Determine if the given key is cast using a custom class.
+
+
+ protected
+ isClassCastable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidCastException
+
+
+
+
+
+
+
+
+
+
+
+
+ isClassDeviable()
+
+
+
+
+
+ Determine if the key is deviable using a custom class.
+
+
+ protected
+ isClassDeviable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidCastException
+
+
+
+
+
+
+
+
+
+
+
+
+ isClassSerializable()
+
+
+
+
+
+ Determine if the key is serializable using a custom class.
+
+
+ protected
+ isClassSerializable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidCastException
+
+
+
+
+
+
+
+
+
+
+
+
+ isCustomDateTimeCast()
+
+
+
+
+
+ Determine if the cast type is a custom date time cast.
+
+
+ protected
+ isCustomDateTimeCast(string $cast) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $cast
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDateAttribute()
+
+
+
+
+
+ Determine if the given attribute is a date or date castable.
+
+
+ protected
+ isDateAttribute(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDateCastable()
+
+
+
+
+
+ Determine whether a value is Date / DateTime castable for inbound manipulation.
+
+
+ protected
+ isDateCastable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determine whether a value is Date / DateTime custom-castable for inbound manipulation.
+
+
+ protected
+ isDateCastableWithCustomFormat(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isDecimalCast()
+
+
+
+
+
+ Determine if the cast type is a decimal cast.
+
+
+ protected
+ isDecimalCast(string $cast) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $cast
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isEncryptedCastable()
+
+
+
+
+
+ Determine whether a value is an encrypted castable for inbound manipulation.
+
+
+ protected
+ isEncryptedCastable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isEnumCastable()
+
+
+
+
+
+ Determine if the given key is cast using an enum.
+
+
+ protected
+ isEnumCastable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isGuardableColumn()
+
+
+
+
+
+ Determine if the given column is a valid, guardable column.
+
+
+ protected
+ isGuardableColumn(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isImmutableCustomDateTimeCast()
+
+
+
+
+
+ Determine if the cast type is an immutable custom date time cast.
+
+
+ protected
+ isImmutableCustomDateTimeCast(string $cast) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $cast
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ isJsonCastable()
+
+
+
+
+
+ Determine whether a value is JSON castable for inbound manipulation.
+
+
+ protected
+ isJsonCastable(string $key) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Determine if the given value is a standard date format.
+
+
+ protected
+ isStandardDateFormat(string $value) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $value
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mergeAttributesFromAttributeCasts()
+
+
+
+
+
+ Merge the cast class attributes back into the model.
+
+
+ protected
+ mergeAttributesFromAttributeCasts() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mergeAttributesFromCachedCasts()
+
+
+
+
+
+ Merge the cast class and attribute cast attributes back into the model.
+
+
+ protected
+ mergeAttributesFromCachedCasts() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mergeAttributesFromClassCasts()
+
+
+
+
+
+ Merge the cast class attributes back into the model.
+
+
+ protected
+ mergeAttributesFromClassCasts() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphEagerTo()
+
+
+
+
+
+ Define a polymorphic, inverse one-to-one or many relationship.
+
+
+ protected
+ morphEagerTo(string $name, string $type, string $id, string $ownerKey) : MorphTo
+
+
+
+
+
+ Parameters
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $id
+ : string
+
+ -
+
+
+ -
+ $ownerKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morphInstanceTo()
+
+
+
+
+
+ Define a polymorphic, inverse one-to-one or many relationship.
+
+
+ protected
+ morphInstanceTo(string $target, string $name, string $type, string $id, string $ownerKey) : MorphTo
+
+
+
+
+
+ Parameters
+
+ -
+ $target
+ : string
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $id
+ : string
+
+ -
+
+
+ -
+ $ownerKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mutateAttribute()
+
+
+
+
+
+ Get the value of an attribute using its mutator.
+
+
+ protected
+ mutateAttribute(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ mutateAttributeForArray()
+
+
+
+
+
+ Get the value of an attribute using its mutator for array conversion.
+
+
+ protected
+ mutateAttributeForArray(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ mutateAttributeMarkedAttribute()
+
+
+
+
+
+ Get the value of an "Attribute" return type marked attribute using its mutator.
+
+
+ protected
+ mutateAttributeMarkedAttribute(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ newBaseQueryBuilder()
+
+
+
+
+
+ Get a new query builder instance for the connection.
+
+
+ protected
+ newBaseQueryBuilder() : Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newBelongsTo()
+
+
+
+
+
+ Instantiate a new BelongsTo relationship.
+
+
+ protected
+ newBelongsTo(Builder $query, Model $child, string $foreignKey, string $ownerKey, string $relation) : BelongsTo
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $child
+ : Model
+
+ -
+
+
+ -
+ $foreignKey
+ : string
+
+ -
+
+
+ -
+ $ownerKey
+ : string
+
+ -
+
+
+ -
+ $relation
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newBelongsToMany()
+
+
+
+
+
+ Instantiate a new BelongsToMany relationship.
+
+
+ protected
+ newBelongsToMany(Builder $query, Model $parent, string $table, string $foreignPivotKey, string $relatedPivotKey, string $parentKey, string $relatedKey[, string|null $relationName = null ]) : BelongsToMany
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $table
+ : string
+
+ -
+
+
+ -
+ $foreignPivotKey
+ : string
+
+ -
+
+
+ -
+ $relatedPivotKey
+ : string
+
+ -
+
+
+ -
+ $parentKey
+ : string
+
+ -
+
+
+ -
+ $relatedKey
+ : string
+
+ -
+
+
+ -
+ $relationName
+ : string|null
+ = null
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newHasMany()
+
+
+
+
+
+ Instantiate a new HasMany relationship.
+
+
+ protected
+ newHasMany(Builder $query, Model $parent, string $foreignKey, string $localKey) : HasMany
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $foreignKey
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newHasManyThrough()
+
+
+
+
+
+ Instantiate a new HasManyThrough relationship.
+
+
+ protected
+ newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) : HasManyThrough
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $farParent
+ : Model
+
+ -
+
+
+ -
+ $throughParent
+ : Model
+
+ -
+
+
+ -
+ $firstKey
+ : string
+
+ -
+
+
+ -
+ $secondKey
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+ -
+ $secondLocalKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newHasOne()
+
+
+
+
+
+ Instantiate a new HasOne relationship.
+
+
+ protected
+ newHasOne(Builder $query, Model $parent, string $foreignKey, string $localKey) : HasOne
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $foreignKey
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newHasOneThrough()
+
+
+
+
+
+ Instantiate a new HasOneThrough relationship.
+
+
+ protected
+ newHasOneThrough(Builder $query, Model $farParent, Model $throughParent, string $firstKey, string $secondKey, string $localKey, string $secondLocalKey) : HasOneThrough
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $farParent
+ : Model
+
+ -
+
+
+ -
+ $throughParent
+ : Model
+
+ -
+
+
+ -
+ $firstKey
+ : string
+
+ -
+
+
+ -
+ $secondKey
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+ -
+ $secondLocalKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newMorphMany()
+
+
+
+
+
+ Instantiate a new MorphMany relationship.
+
+
+ protected
+ newMorphMany(Builder $query, Model $parent, string $type, string $id, string $localKey) : MorphMany
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $id
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newMorphOne()
+
+
+
+
+
+ Instantiate a new MorphOne relationship.
+
+
+ protected
+ newMorphOne(Builder $query, Model $parent, string $type, string $id, string $localKey) : MorphOne
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $id
+ : string
+
+ -
+
+
+ -
+ $localKey
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newMorphTo()
+
+
+
+
+
+ Instantiate a new MorphTo relationship.
+
+
+ protected
+ newMorphTo(Builder $query, Model $parent, string $foreignKey, string $ownerKey, string $type, string $relation) : MorphTo
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $foreignKey
+ : string
+
+ -
+
+
+ -
+ $ownerKey
+ : string
+
+ -
+
+
+ -
+ $type
+ : string
+
+ -
+
+
+ -
+ $relation
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ newMorphToMany()
+
+
+
+
+
+ Instantiate a new MorphToMany relationship.
+
+
+ protected
+ newMorphToMany(Builder $query, Model $parent, string $name, string $table, string $foreignPivotKey, string $relatedPivotKey, string $parentKey, string $relatedKey[, string|null $relationName = null ][, bool $inverse = false ]) : MorphToMany
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+ -
+ $parent
+ : Model
+
+ -
+
+
+ -
+ $name
+ : string
+
+ -
+
+
+ -
+ $table
+ : string
+
+ -
+
+
+ -
+ $foreignPivotKey
+ : string
+
+ -
+
+
+ -
+ $relatedPivotKey
+ : string
+
+ -
+
+
+ -
+ $parentKey
+ : string
+
+ -
+
+
+ -
+ $relatedKey
+ : string
+
+ -
+
+
+ -
+ $relationName
+ : string|null
+ = null
+ -
+
+
+ -
+ $inverse
+ : bool
+ = false
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create a new model instance for a related model.
+
+
+ protected
+ newRelatedInstance(string $class) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ normalizeCastClassResponse()
+
+
+
+
+
+ Normalize the response from a custom class caster.
+
+
+ protected
+ normalizeCastClassResponse(string $key, mixed $value) : array<string|int, mixed>
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ array<string|int, mixed>
+
+
+
+
+
+ parseCasterClass()
+
+
+
+
+
+ Parse the given caster class, removing any arguments.
+
+
+ protected
+ parseCasterClass(string $class) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+
+
+ Perform the actual delete query on this model instance.
+
+
+ protected
+ performDeleteOnModel() : void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Perform a model insert operation.
+
+
+ protected
+ performInsert(Builder $query) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Perform a model update operation.
+
+
+ protected
+ performUpdate(Builder $query) : bool
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ registerModelEvent()
+
+
+
+
+
+ Register a model event with the dispatcher.
+
+
+ protected
+ static registerModelEvent(string $event, QueuedClosure|Closure|string $callback) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $event
+ : string
+
+ -
+
+
+ -
+ $callback
+ : QueuedClosure|Closure|string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ registerObserver()
+
+
+
+
+
+ Register a single observer with the model.
+
+
+ protected
+ registerObserver(object|string $class) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : object|string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ RuntimeException
+
+
+
+
+
+
+
+
+
+
+
+ resolveCasterClass()
+
+
+
+
+
+ Resolve the custom caster class for a given key.
+
+
+ protected
+ resolveCasterClass(string $key) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveChildRouteBindingQuery()
+
+
+
+
+
+ Retrieve the child model query for a bound value.
+
+
+ protected
+ resolveChildRouteBindingQuery(string $childType, mixed $value, string|null $field) : Relation
+
+
+
+
+
+ Parameters
+
+ -
+ $childType
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+ -
+ $field
+ : string|null
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ serializeClassCastableAttribute()
+
+
+
+
+
+ Serialize the given attribute using the custom cast class.
+
+
+ protected
+ serializeClassCastableAttribute(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ serializeDate()
+
+
+
+
+
+ Prepare a date for array / JSON serialization.
+
+
+ protected
+ serializeDate(DateTimeInterface $date) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $date
+ : DateTimeInterface
+
+ -
+
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+ setAttributeMarkedMutatedAttributeValue()
+
+
+
+
+
+ Set the value of a "Attribute" return type marked attribute using its mutator.
+
+
+ protected
+ setAttributeMarkedMutatedAttributeValue(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setClassCastableAttribute()
+
+
+
+
+
+ Set the value of a class castable attribute.
+
+
+ protected
+ setClassCastableAttribute(string $key, mixed $value) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setEnumCastableAttribute()
+
+
+
+
+
+ Set the value of an enum castable attribute.
+
+
+ protected
+ setEnumCastableAttribute(string $key, BackedEnum $value) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : BackedEnum
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ setKeysForSaveQuery()
+
+
+
+
+
+ Set the keys for a save update query.
+
+
+ protected
+ setKeysForSaveQuery(Builder $query) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setKeysForSelectQuery()
+
+
+
+
+
+ Set the keys for a select query.
+
+
+ protected
+ setKeysForSelectQuery(Builder $query) : Builder
+
+
+
+
+
+ Parameters
+
+ -
+ $query
+ : Builder
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setMutatedAttributeValue()
+
+
+
+
+
+ Set the value of an attribute using its mutator.
+
+
+ protected
+ setMutatedAttributeValue(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ throwBadMethodCallException()
+
+
+
+
+
+ Throw a bad method call exception for the given method.
+
+
+ protected
+ static throwBadMethodCallException(string $method) : void
+
+
+
+
+
+ Parameters
+
+ -
+ $method
+ : string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ BadMethodCallException
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Transform a raw model value using mutators, casts, etc.
+
+
+ protected
+ transformModelValue(string $key, mixed $value) : mixed
+
+
+
+
+
+ Parameters
+
+ -
+ $key
+ : string
+
+ -
+
+
+ -
+ $value
+ : mixed
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ resolveObserverClassName()
+
+
+
+
+
+ Resolve the observer's class name from an object or string.
+
+
+ private
+ resolveObserverClassName(object|string $class) : string
+
+
+
+
+
+ Parameters
+
+ -
+ $class
+ : object|string
+
+ -
+
+
+
+
+
+
+
+ -
+ throws
+
+ -
+ InvalidArgumentException
+
+
+
+
+
+
+
+
+ Return values
+ string
+
+
+
+
+
+