October\Rain\Database\Model

Overview

Model is an active record base class that extends Eloquent with added extendability and deferred bindings.

Extends
  • Illuminate\Database\Eloquent\Model
Implements
  • Stringable
  • Illuminate\Contracts\Routing\UrlRoutable
  • Illuminate\Contracts\Queue\QueueableEntity
  • JsonSerializable
  • Illuminate\Contracts\Support\Jsonable
  • Illuminate\Contracts\Broadcasting\HasBroadcastChannel
  • Illuminate\Contracts\Support\CanBeEscapedWhenCastToString
  • ArrayAccess
  • Illuminate\Contracts\Support\Arrayable

Public Properties

public array $implement

implement behaviors for this model.

public array $attributes

attributes are public so behaviors can modify them.

public bool $trimStrings

trimStrings will trim all string attributes of whitespace

public array $hasOne

hasOne related record, inverse of belongsTo.

protected $hasOne = [
    'owner' => [User::class, 'key' => 'user_id']
];

public array $hasMany

hasMany related records, inverse of belongsTo.

protected $hasMany = [
    'items' => Item::class
];

public array $belongsTo

belongsTo another record with a local key attribute

protected $belongsTo = [
    'parent' => [Category::class, 'key' => 'parent_id']
];

public array $belongsToMany

belongsToMany to multiple records using a join table.

protected $belongsToMany = [
    'groups' => [Group::class, 'table'=> 'join_groups_users']
];

public array $morphTo

morphTo another record using local key and type attributes

protected $morphTo = [
    'pictures' => []
];

public array $morphOne

morphOne related record, inverse of morphTo.

protected $morphOne = [
    'log' => [History::class, 'name' => 'user']
];

public array $morphMany

morphMany related records, inverse of morphTo.

protected $morphMany = [
    'log' => [History::class, 'name' => 'user']
];

public array $morphToMany

morphToMany to multiple records using a join table.

protected $morphToMany = [
    'tag' => [Tag::class, 'table' => 'tagables', 'name' => 'tagable']
];

public array $morphedByMany

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

public $morphedByMany = [
    'tag' => [Tag::class, 'table' => 'tagables', 'name' => 'tagable']
];

public array $attachOne

attachOne file attachment.

protected $attachOne = [
    'picture' => [\October\Rain\Database\Attach\File::class, 'public' => false]
];

public array $attachMany

attachMany file attachments.

protected $attachMany = [
    'pictures' => [\October\Rain\Database\Attach\File::class, 'name'=> 'imageable']
];

public array $hasManyThrough

hasManyThrough is related records through another record.

protected $hasManyThrough = [
    'posts' => [Post::class, 'through' => User::class]
];

public array $hasOneThrough

hasOneThrough is a related record through another record.

protected $hasOneThrough = [
    'post' => [Post::class, 'through' => User::class]
];

public string $sessionKey

sessionKey is a unique session key used for deferred binding

Show inherited public properties

Inherited Public Properties

  • $incrementing - Indicates if the IDs are auto-incrementing. (defined in Illuminate\Database\Eloquent\Model)
  • $preventsLazyLoading - Indicates whether lazy loading will be prevented on this model. (defined in Illuminate\Database\Eloquent\Model)
  • $exists - Indicates if the model exists. (defined in Illuminate\Database\Eloquent\Model)
  • $wasRecentlyCreated - Indicates if the model was inserted during the current request lifecycle. (defined in Illuminate\Database\Eloquent\Model)
  • $snakeAttributes - Indicates whether attributes are snake cased on arrays. (defined in Illuminate\Database\Eloquent\Model)
  • $encrypter - The encrypter instance that is used to encrypt attributes. (defined in Illuminate\Database\Eloquent\Model)
  • $manyMethods - The many to many relationship methods. (defined in Illuminate\Database\Eloquent\Model)
  • $timestamps - Indicates if the model should be timestamped. (defined in Illuminate\Database\Eloquent\Model)

Protected Properties

protected array $dates

dates are attributes to convert to an instance of Carbon/DateTime objects.

protected array $savingOptions

savingOptions used by the {@link save()} method.

protected static array $eventsBooted

eventsBooted is an array of models booted events

protected array $jsonable

jsonable attribute names that are json encoded and decoded from the database

protected static array $relationTypes

relationTypes expected, used to cycle and verify relationships.

protected array $emitterSingleEventCollection

emitterSingleEventCollection of events to be fired once only

protected array $emitterEventCollection

emitterEventCollection of all registered events

protected array $emitterEventSorted

emitterEventSorted collection

protected array $extensionData

extensionData contains class reflection information, including behaviors

protected static array $extendableStaticMethods

extendableStaticMethods is a collection of static methods used by behaviors

protected static bool $extendableGuardProperties

extendableGuardProperties indicates if dynamic properties can be created

Show inherited protected properties

Inherited Protected Properties

  • $connection - The connection name for the model. (defined in Illuminate\Database\Eloquent\Model)
  • $table - The table associated with the model. (defined in Illuminate\Database\Eloquent\Model)
  • $primaryKey - The primary key for the model. (defined in Illuminate\Database\Eloquent\Model)
  • $keyType - The "type" of the primary key ID. (defined in Illuminate\Database\Eloquent\Model)
  • $with - The relations to eager load on every query. (defined in Illuminate\Database\Eloquent\Model)
  • $withCount - The relationship counts that should be eager loaded on every query. (defined in Illuminate\Database\Eloquent\Model)
  • $perPage - The number of models to return for pagination. (defined in Illuminate\Database\Eloquent\Model)
  • $escapeWhenCastingToString - Indicates that the object's string representation should be escaped when __toString is invoked. (defined in Illuminate\Database\Eloquent\Model)
  • $resolver - The connection resolver instance. (defined in Illuminate\Database\Eloquent\Model)
  • $dispatcher - The event dispatcher instance. (defined in Illuminate\Database\Eloquent\Model)
  • $booted - The array of booted models. (defined in Illuminate\Database\Eloquent\Model)
  • $traitInitializers - The array of trait initializers that will be called on each new instance. (defined in Illuminate\Database\Eloquent\Model)
  • $globalScopes - The array of global scopes on the model. (defined in Illuminate\Database\Eloquent\Model)
  • $ignoreOnTouch - The list of models classes that should not be affected with touch. (defined in Illuminate\Database\Eloquent\Model)
  • $modelsShouldPreventLazyLoading - Indicates whether lazy loading should be restricted on all models. (defined in Illuminate\Database\Eloquent\Model)
  • $lazyLoadingViolationCallback - The callback that is responsible for handling lazy loading violations. (defined in Illuminate\Database\Eloquent\Model)
  • $modelsShouldPreventSilentlyDiscardingAttributes - Indicates if an exception should be thrown instead of silently discarding non-fillable attributes. (defined in Illuminate\Database\Eloquent\Model)
  • $discardedAttributeViolationCallback - The callback that is responsible for handling discarded attribute violations. (defined in Illuminate\Database\Eloquent\Model)
  • $modelsShouldPreventAccessingMissingAttributes - Indicates if an exception should be thrown when trying to access a missing attribute on a retrieved model. (defined in Illuminate\Database\Eloquent\Model)
  • $missingAttributeViolationCallback - The callback that is responsible for handling missing attribute violations. (defined in Illuminate\Database\Eloquent\Model)
  • $isBroadcasting - Indicates if broadcasting is currently enabled. (defined in Illuminate\Database\Eloquent\Model)
  • $original - The model attribute's original state. (defined in Illuminate\Database\Eloquent\Model)
  • $changes - The changed model attributes. (defined in Illuminate\Database\Eloquent\Model)
  • $casts - The attributes that should be cast. (defined in Illuminate\Database\Eloquent\Model)
  • $classCastCache - The attributes that have been cast using custom classes. (defined in Illuminate\Database\Eloquent\Model)
  • $attributeCastCache - The attributes that have been cast using "Attribute" return type mutators. (defined in Illuminate\Database\Eloquent\Model)
  • $primitiveCastTypes - The built-in, primitive cast types supported by Eloquent. (defined in Illuminate\Database\Eloquent\Model)
  • $dateFormat - The storage format of the model's date columns. (defined in Illuminate\Database\Eloquent\Model)
  • $appends - The accessors to append to the model's array form. (defined in Illuminate\Database\Eloquent\Model)
  • $mutatorCache - The cache of the mutated attributes for each class. (defined in Illuminate\Database\Eloquent\Model)
  • $attributeMutatorCache - The cache of the "Attribute" return type marked mutated attributes for each class. (defined in Illuminate\Database\Eloquent\Model)
  • $getAttributeMutatorCache - The cache of the "Attribute" return type marked mutated, gettable attributes for each class. (defined in Illuminate\Database\Eloquent\Model)
  • $setAttributeMutatorCache - The cache of the "Attribute" return type marked mutated, settable attributes for each class. (defined in Illuminate\Database\Eloquent\Model)
  • $castTypeCache - The cache of the converted cast types. (defined in Illuminate\Database\Eloquent\Model)
  • $dispatchesEvents - The event map for the model. (defined in Illuminate\Database\Eloquent\Model)
  • $observables - User exposed observable events. (defined in Illuminate\Database\Eloquent\Model)
  • $relations - The loaded relationships for the model. (defined in Illuminate\Database\Eloquent\Model)
  • $touches - The relationships that should be touched on save. (defined in Illuminate\Database\Eloquent\Model)
  • $relationResolvers - The relation resolver callbacks. (defined in Illuminate\Database\Eloquent\Model)
  • $ignoreTimestampsOn - The list of models classes that have timestamps temporarily disabled. (defined in Illuminate\Database\Eloquent\Model)
  • $hidden - The attributes that should be hidden for serialization. (defined in Illuminate\Database\Eloquent\Model)
  • $visible - The attributes that should be visible in serialization. (defined in Illuminate\Database\Eloquent\Model)
  • $fillable - The attributes that are mass assignable. (defined in Illuminate\Database\Eloquent\Model)
  • $guarded - The attributes that aren't mass assignable. (defined in Illuminate\Database\Eloquent\Model)
  • $unguarded - Indicates if all mass assignment is enabled. (defined in Illuminate\Database\Eloquent\Model)
  • $guardableColumns - The actual columns that exist on the database and can be guarded. (defined in Illuminate\Database\Eloquent\Model)

Public Methods

public __call()

public __call($name, $params): void

public __construct()

public __construct($attributes = []): void

public __get()

public __get($name): void

public __isset()

public __isset(string $key): bool 

__isset determines if an attribute or relation exists on the model.

public __set()

public __set($name, $value): void

public __sleep()

public __sleep(): void

__sleep prepare the object for serialization.

public __wakeup()

public __wakeup(): void

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

public addCasts()

public addCasts(array $attributes): void 

addCasts adds attribute casts for the model.

public addDateAttribute()

public addDateAttribute(string $attribute): void 

addDateAttribute adds a datetime attribute to convert to an instance of Carbon/DateTime object.

public addDynamicMethod()

public addDynamicMethod(
    string $dynamicName,
    callable $method,
    string $extension = null
): void

addDynamicMethod programmatically adds a method to the extendable class

public addDynamicProperty()

public addDynamicProperty(string $dynamicName, string $value = null): void

addDynamicProperty programmatically adds a property to the extendable class

public addFillable()

public addFillable(array|string|null $attributes = null): void 

addFillable attributes for the model.

public addJsonable()

public addJsonable(array|string|null $attributes = null): void 

addJsonable attributes for the model.

public addVisible()

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

addVisible attributes for the model.

public alwaysPush()

public alwaysPush(array $options, string $sessionKey): bool 

alwaysPush pushes the first level of relations even if the parent model has no changes.

public asExtension()

public asExtension(string $shortName): mixed 

asExtension is short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

public attachMany()

public attachMany(
    $related,
    $isPublic = null,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\MorphMany 

attachMany defines an attachment one-to-many relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public attachOne()

public attachOne(
    $related,
    $isPublic = true,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\MorphOne 

attachOne defines an attachment one-to-one relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public attributesToArray()

public attributesToArray(): array 

attributesToArray converts the model's attributes to an array.

public belongsTo()

public belongsTo(
    $related,
    $foreignKey = null,
    $parentKey = null,
    $relationName = null
): October\Rain\Database\Relations\BelongsTo 

belongsTo defines an inverse one-to-one or many relationship. Overridden from \Eloquent\Model to allow the usage of the intermediary methods to handle the relationsData array.

public belongsToMany()

public belongsToMany(
    $related,
    $table = null,
    $primaryKey = null,
    $foreignKey = null,
    $parentKey = null,
    $relatedKey = null,
    $relationName = null
): October\Rain\Database\Relations\BelongsToMany 

belongsToMany defines a many-to-many relationship. This code is almost a duplicate of Eloquent but uses a Rain relation class.

public bindDeferred()

public bindDeferred(
    $relation,
    $record,
    $sessionKey,
    $pivotData = []
): October\Rain\Database\Models\DeferredBinding 

bindDeferred binds a deferred relationship to the supplied record

public bindEvent()

public bindEvent($event, $callback, $priority = 0): void 

bindEvent creates a new event binding

public bindEventOnce()

public bindEventOnce($event, $callback, $priority = 0): void 

bindEventOnce creates a new event binding that fires once only

public cancelDeferred()

public cancelDeferred($sessionKey): void 

cancelDeferred cancels all deferred bindings to this model

public static clearExtendedClasses()

public static clearExtendedClasses(): void

public commitDeferred()

public commitDeferred($sessionKey): void

commitDeferred commits all deferred bindings to this model

public static create()

public static create(
    array $attributes = [],
    string $sessionKey = null
): Illuminate\Database\Eloquent\Model|static 

create a new model and return the instance.

public duplicateWithRelations()

public duplicateWithRelations(array|null $except = null): static 

duplicateWithRelations replicates a model with special multisite duplication logic. To avoid duplication of has many relations, the logic only propagates relations on the parent model since they are shared via site_root_id beyond this point.

public static extend()

public static extend($callback): void

extend this object properties upon construction.

public extendClassWith()

public extendClassWith(string $extensionName): void 

extendClassWith dynamically extends a class with a specified behavior

public extendableCall()

public extendableCall(string $name, array $params = null): mixed 

extendableCall magic method for __call()

public static extendableCallStatic()

public static extendableCallStatic(
    string $name,
    array $params = null
): mixed 

extendableCallStatic magic method for __callStatic()

public extendableConstruct()

public extendableConstruct(): void

extendableConstruct should be called as part of the constructor

public extendableDestruct()

public extendableDestruct(): void

extendableDestruct should be called when serializing the object

public static extendableExtendCallback()

public static extendableExtendCallback(callable $callback): void 

extendableExtendCallback is a helper method for ::extend() static method

public extendableGet()

public extendableGet(string $name): string 

extendableGet magic method for __get()

public extendableSet()

public extendableSet(string $name, string $value): string 

extendableSet magic method for __set()

public static fetched()

public static fetched(Closure|string $callback): void 

fetched creates a new native event for handling afterFetch().

public static fetching()

public static fetching(Closure|string $callback): void 

fetching creates a new native event for handling beforeFetch().

public fireEvent()

public fireEvent(
    string $event,
    array $params = [],
    boolean $halt = false
): array 

fireEvent and call the listeners

public static flushEventListeners()

public static flushEventListeners(): void 

flushEventListeners removes all of the event listeners for the model Also flush registry of models that had events booted Allows painless unit testing.

public getAttribute()

public getAttribute($key): mixed 

getAttribute from the model. Overridden from {@link Eloquent} to implement recognition of the relation.

public getAttributeValue()

public getAttributeValue(string $key): mixed 

getAttributeValue gets a plain attribute (not a relationship).

public getClassExtension()

public getClassExtension(string $name): mixed 

getClassExtension returns a behavior object from an extendable class, example:

$this->getClassExtension('Backend.Behaviors.FormController')

public getClassMethodAsReflector()

public getClassMethodAsReflector($name): ReflectionFunctionAbstract 

public getClassMethods()

public getClassMethods(): array 

getClassMethods gets a list of class methods, extension equivalent of get_class_methods()

public getDates()

public getDates(): array 

getDates returns the attributes that should be converted to dates.

public getDynamicProperties()

public getDynamicProperties(): array 

getDynamicProperties returns all dynamic properties and their values

public getJsonable()

public getJsonable(): array 

getJsonable attributes name

public getObservableEvents()

public getObservableEvents(): array 

getObservableEvents as their names.

public getRelationDefinition()

public getRelationDefinition($name): array 

getRelationDefinition returns relationship details from a supplied name

public getRelationDefinitions()

public getRelationDefinitions(): array 

getRelationDefinitions returns relationship details for all relations defined on this model

public getRelationSimpleValue()

public getRelationSimpleValue($relationName): void

getRelationSimpleValue returns a relation key value(s), not as an object.

public getRelationType()

public getRelationType(string $name): October\Rain\Database\Relation 

getRelationType returns a relationship type based on a supplied name

public getSaveOption()

public getSaveOption($key, $default = null): mixed 

getSaveOption returns an option used while saving the model.

public hasDeferred()

public hasDeferred($sessionKey = null, $relationName = null): bool 

hasDeferred returns true if a deferred record exists for a relation

public hasGetMutator()

public hasGetMutator(string $key): bool 

hasGetMutator determines if a get mutator exists for an attribute.

public hasMany()

public hasMany(
    $related,
    $primaryKey = null,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\HasMany 

hasMany defines a one-to-many relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public hasManyThrough()

public hasManyThrough(
    $related,
    $through,
    $primaryKey = null,
    $throughKey = null,
    $localKey = null,
    $secondLocalKey = null,
    $relationName = null
): October\Rain\Database\Relations\HasManyThrough 

hasManyThrough defines a has-many-through relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public hasOne()

public hasOne(
    $related,
    $primaryKey = null,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\HasOne 

hasOne defines a one-to-one relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public hasOneThrough()

public hasOneThrough(
    $related,
    $through,
    $primaryKey = null,
    $throughKey = null,
    $localKey = null,
    $secondLocalKey = null,
    $relationName = null
): October\Rain\Database\Relations\HasOneThrough 

hasOneThrough define a has-one-through relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public hasRelation()

public hasRelation($name): bool 

hasRelation checks if model has a relationship by supplied name

public hasSetMutator()

public hasSetMutator(string $key): bool 

hasSetMutator determines if a set mutator exists for an attribute.

public implementClassWith()

public implementClassWith($extensionName): void

implementClassWith will implement an extension using non-interference and should be used with the static extend() method.

public isClassExtendedWith()

public isClassExtendedWith(string $name): boolean 

isClassExtendedWith checks if extendable class is extended with a behavior object

public isClassInstanceOf()

public isClassInstanceOf($interface): bool 

isClassInstanceOf checks if the class implements the supplied interface methods.

public isDeferrable()

public isDeferrable($relationName): bool 

isDeferrable returns true if a relation exists and can be deferred

public isJsonable()

public isJsonable($key): array 

isJsonable checks if an attribute is jsonable or not.

public isRelationPushable()

public isRelationPushable($name): bool 

isRelationPushable determines whether the specified relation should be saved when push() is called instead of save() on the model. Defaults to true.

public isRelationTypeSingular()

public isRelationTypeSingular($name): bool 

isRelationTypeSingular returns true if the relation is expected to return a single record versus a collection of records.

public jsonable()

public jsonable(array $jsonable): $this 

jsonable attributes set for the model.

public static make()

public static make(
    array $attributes = []
): Illuminate\Database\Eloquent\Model|static 

make a new model and return the instance

public makeRelation()

public makeRelation(string $name): Model|null 

makeRelation returns a relation class object, supporting nested relations with dot notation

public methodExists()

public methodExists(string $name): boolean 

methodExists checks if a method exists, extension equivalent of method_exists()

public morphMany()

public morphMany(
    $related,
    $name,
    $type = null,
    $id = null,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\MorphMany 

morphMany defines a polymorphic one-to-many relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public morphOne()

public morphOne(
    $related,
    $name,
    $type = null,
    $id = null,
    $localKey = null,
    $relationName = null
): October\Rain\Database\Relations\MorphOne 

morphOne defines a polymorphic one-to-one relationship. This code is a duplicate of Eloquent but uses a Rain relation class.

public morphTo()

public morphTo(
    $name = null,
    $type = null,
    $id = null,
    $ownerKey = null
): October\Rain\Database\Relations\BelongsTo 

morphTo defines a polymorphic, inverse one-to-one or many relationship. Overridden from \Eloquent\Model to allow the usage of the intermediary methods to handle the relation.

public morphToMany()

public morphToMany(
    $related,
    $name,
    $table = null,
    $primaryKey = null,
    $foreignKey = null,
    $parentKey = null,
    $relatedKey = null,
    $inverse = false,
    $relationName = null
): October\Rain\Database\Relations\MorphToMany 

morphToMany defines a polymorphic many-to-many relationship. This code is almost a duplicate of Eloquent but uses a Rain relation class.

public morphedByMany()

public morphedByMany(
    $related,
    $name,
    $table = null,
    $primaryKey = null,
    $foreignKey = null,
    $parentKey = null,
    $relatedKey = null,
    $relationName = null
): October\Rain\Database\Relations\MorphToMany 

morphedByMany defines a polymorphic many-to-many inverse relationship. This code is almost a duplicate of Eloquent but uses a Rain relation class.

public newCollection()

public newCollection($models = ]): [October\Rain\Database\Collection 

newCollection instance.

public newEloquentBuilder()

public newEloquentBuilder(
    October\Rain\Database\QueryBuilder $query
): October\Rain\Database\Builder 

newEloquentBuilder for the model.

public newFromBuilder()

public newFromBuilder(
    array $attributes = [],
    $connection = null
): Illuminate\Database\Eloquent\Model|static 

newFromBuilder creates a new model instance that is existing.

public newInstance()

public newInstance(
    array $attributes = [],
    bool $exists = false
): static 

newInstance creates a new instance of the given model.

public newPivot()

public newPivot(
    October\Rain\Database\Model $parent,
    array $attributes,
    string $table,
    bool $exists,
    string|null $using = null
): October\Rain\Database\Pivot 

newPivot as a generic pivot model instance.

public newRelationPivot()

public newRelationPivot(
    October\Rain\Database\Model $parent,
    string $relationName,
    array $attributes,
    string $table,
    bool $exists
): October\Rain\Database\Pivot 

newRelationPivot instance specific to a relation.

public newReplicationInstance()

public newReplicationInstance($attributes): void

newReplicationInstance returns a new instance used by the replicator

public propertyExists()

public propertyExists(string $name): boolean 

propertyExists checks if a property exists, extension equivalent of property_exists()

public push()

public push(array $options = null, null $sessionKey = null): bool 

push saves the model and all of its relationships.

public reload()

public reload(): Illuminate\Database\Eloquent\Model|static 

reload the model attributes from the database.

public reloadRelations()

public reloadRelations($relationName = null): void

public replicateWithRelations()

public replicateWithRelations(array|null $except = null): static 

replicateWithRelations replicates the model into a new, non-existing instance, including replicating relations.

public save()

public save(array $options = null, null $sessionKey = null): bool 

save the model to the database.

public setAttribute()

public setAttribute(string $key, mixed $value): void 

setAttribute sets a given attribute on the model.

public unbindDeferred()

public unbindDeferred(
    $relation,
    $record,
    $sessionKey
): October\Rain\Database\Models\DeferredBinding 

unbindDeferred unbinds a deferred relationship to the supplied record

public unbindEvent()

public unbindEvent($event = null): void 

unbindEvent destroys an event binding

Show inherited public methods

Inherited Public Methods

  • __callStatic() - Handle dynamic static method calls into the model. (defined in Illuminate\Database\Eloquent\Model)
  • __toString() - Convert the model to its string representation. (defined in Illuminate\Database\Eloquent\Model)
  • __unset() - Unset an attribute on the model. (defined in Illuminate\Database\Eloquent\Model)
  • addGlobalScope() - Register a new global scope on the model. (defined in Illuminate\Database\Eloquent\Model)
  • addObservableEvents() - Add an observable event name. (defined in Illuminate\Database\Eloquent\Model)
  • all() - Get all of the models from the database. (defined in Illuminate\Database\Eloquent\Model)
  • append() - Append attributes to query when building a query. (defined in Illuminate\Database\Eloquent\Model)
  • broadcastChannel() - Get the broadcast channel name that is associated with the given entity. (defined in Illuminate\Database\Eloquent\Model)
  • broadcastChannelRoute() - Get the broadcast channel route definition that is associated with the given entity. (defined in Illuminate\Database\Eloquent\Model)
  • cacheMutatedAttributes() - Extract and cache all the mutated attributes of a class. (defined in Illuminate\Database\Eloquent\Model)
  • callNamedScope() - Apply the given named scope if possible. (defined in Illuminate\Database\Eloquent\Model)
  • clearBootedModels() - Clear the list of booted models so they will be re-booted. (defined in Illuminate\Database\Eloquent\Model)
  • created() - Register a created model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • creating() - Register a creating model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • delete() - Delete the model from the database. (defined in Illuminate\Database\Eloquent\Model)
  • deleteOrFail() - Delete the model from the database within a transaction. (defined in Illuminate\Database\Eloquent\Model)
  • deleteQuietly() - Delete the model from the database without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • deleted() - Register a deleted model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • deleting() - Register a deleting model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • destroy() - Destroy the models for the given IDs. (defined in Illuminate\Database\Eloquent\Model)
  • discardChanges() - Discard attribute changes and reset the attributes to their original state. (defined in Illuminate\Database\Eloquent\Model)
  • encryptUsing() - Set the encrypter instance that will be used to encrypt attributes. (defined in Illuminate\Database\Eloquent\Model)
  • escapeWhenCastingToString() - Indicate that the object's string representation should be escaped when __toString is invoked. (defined in Illuminate\Database\Eloquent\Model)
  • fill() - Fill the model with an array of attributes. (defined in Illuminate\Database\Eloquent\Model)
  • fillJsonAttribute() - Set a given JSON attribute on the model. (defined in Illuminate\Database\Eloquent\Model)
  • fillable() - Set the fillable attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • forceDelete() - Force a hard delete on a soft deleted model. (defined in Illuminate\Database\Eloquent\Model)
  • forceFill() - Fill the model with an array of attributes. Force mass assignment. (defined in Illuminate\Database\Eloquent\Model)
  • fresh() - Reload a fresh model instance from the database. (defined in Illuminate\Database\Eloquent\Model)
  • freshTimestamp() - Get a fresh timestamp for the model. (defined in Illuminate\Database\Eloquent\Model)
  • freshTimestampString() - Get a fresh timestamp for the model. (defined in Illuminate\Database\Eloquent\Model)
  • fromDateTime() - Convert a DateTime to a storable string. (defined in Illuminate\Database\Eloquent\Model)
  • fromEncryptedString() - Decrypt the given encrypted string. (defined in Illuminate\Database\Eloquent\Model)
  • fromFloat() - Decode the given float. (defined in Illuminate\Database\Eloquent\Model)
  • fromJson() - Decode the given JSON back into an array or object. (defined in Illuminate\Database\Eloquent\Model)
  • getActualClassNameForMorph() - Retrieve the actual class name for a given morph class. (defined in Illuminate\Database\Eloquent\Model)
  • getAppends() - Get the accessors that are being appended to model arrays. (defined in Illuminate\Database\Eloquent\Model)
  • getAttributes() - Get all of the current attributes on the model. (defined in Illuminate\Database\Eloquent\Model)
  • getCasts() - Get the casts array. (defined in Illuminate\Database\Eloquent\Model)
  • getChanges() - Get the attributes that were changed when the model was last saved. (defined in Illuminate\Database\Eloquent\Model)
  • getConnection() - Get the database connection for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getConnectionName() - Get the current connection name for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getConnectionResolver() - Get the connection resolver instance. (defined in Illuminate\Database\Eloquent\Model)
  • getCreatedAtColumn() - Get the name of the "created at" column. (defined in Illuminate\Database\Eloquent\Model)
  • getDateFormat() - Get the format for database stored dates. (defined in Illuminate\Database\Eloquent\Model)
  • getDirty() - Get the attributes that have been changed since the last sync. (defined in Illuminate\Database\Eloquent\Model)
  • getEventDispatcher() - Get the event dispatcher instance. (defined in Illuminate\Database\Eloquent\Model)
  • getFillable() - Get the fillable attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getForeignKey() - Get the default foreign key name for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getGlobalScope() - Get a global scope registered with the model. (defined in Illuminate\Database\Eloquent\Model)
  • getGlobalScopes() - Get the global scopes for this class instance. (defined in Illuminate\Database\Eloquent\Model)
  • getGuarded() - Get the guarded attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getHidden() - Get the hidden attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getIncrementing() - Get the value indicating whether the IDs are incrementing. (defined in Illuminate\Database\Eloquent\Model)
  • getKey() - Get the value of the model's primary key. (defined in Illuminate\Database\Eloquent\Model)
  • getKeyName() - Get the primary key for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getKeyType() - Get the auto-incrementing key type. (defined in Illuminate\Database\Eloquent\Model)
  • getMorphClass() - Get the class name for polymorphic relations. (defined in Illuminate\Database\Eloquent\Model)
  • getMutatedAttributes() - Get the mutated attributes for a given instance. (defined in Illuminate\Database\Eloquent\Model)
  • getOriginal() - Get the model's original attribute values. (defined in Illuminate\Database\Eloquent\Model)
  • getPerPage() - Get the number of models to return per page. (defined in Illuminate\Database\Eloquent\Model)
  • getQualifiedCreatedAtColumn() - Get the fully qualified "created at" column. (defined in Illuminate\Database\Eloquent\Model)
  • getQualifiedKeyName() - Get the table qualified key name. (defined in Illuminate\Database\Eloquent\Model)
  • getQualifiedUpdatedAtColumn() - Get the fully qualified "updated at" column. (defined in Illuminate\Database\Eloquent\Model)
  • getQueueableConnection() - Get the queueable connection for the entity. (defined in Illuminate\Database\Eloquent\Model)
  • getQueueableId() - Get the queueable identity for the entity. (defined in Illuminate\Database\Eloquent\Model)
  • getQueueableRelations() - Get the queueable relationships for the entity. (defined in Illuminate\Database\Eloquent\Model)
  • getRawOriginal() - Get the model's raw original attribute values. (defined in Illuminate\Database\Eloquent\Model)
  • getRelation() - Get a specified relationship. (defined in Illuminate\Database\Eloquent\Model)
  • getRelationValue() - Get a relationship. (defined in Illuminate\Database\Eloquent\Model)
  • getRelations() - Get all the loaded relations for the instance. (defined in Illuminate\Database\Eloquent\Model)
  • getRouteKey() - Get the value of the model's route key. (defined in Illuminate\Database\Eloquent\Model)
  • getRouteKeyName() - Get the route key for the model. (defined in Illuminate\Database\Eloquent\Model)
  • getTable() - Get the table associated with the model. (defined in Illuminate\Database\Eloquent\Model)
  • getTouchedRelations() - Get the relationships that are touched on save. (defined in Illuminate\Database\Eloquent\Model)
  • getUpdatedAtColumn() - Get the name of the "updated at" column. (defined in Illuminate\Database\Eloquent\Model)
  • getVisible() - Get the visible attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • guard() - Set the guarded attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • handleDiscardedAttributeViolationUsing() - Register a callback that is responsible for handling discarded attribute violations. (defined in Illuminate\Database\Eloquent\Model)
  • handleLazyLoadingViolationUsing() - Register a callback that is responsible for handling lazy loading violations. (defined in Illuminate\Database\Eloquent\Model)
  • handleMissingAttributeViolationUsing() - Register a callback that is responsible for handling lazy loading violations. (defined in Illuminate\Database\Eloquent\Model)
  • hasAppended() - Return whether the accessor attribute has been appended. (defined in Illuminate\Database\Eloquent\Model)
  • hasAttributeGetMutator() - Determine if a "Attribute" return type marked get mutator exists for an attribute. (defined in Illuminate\Database\Eloquent\Model)
  • hasAttributeMutator() - Determine if a "Attribute" return type marked mutator exists for an attribute. (defined in Illuminate\Database\Eloquent\Model)
  • hasAttributeSetMutator() - Determine if an "Attribute" return type marked set mutator exists for an attribute. (defined in Illuminate\Database\Eloquent\Model)
  • hasCast() - Determine whether an attribute should be cast to a native type. (defined in Illuminate\Database\Eloquent\Model)
  • hasGlobalScope() - Determine if a model has a global scope. (defined in Illuminate\Database\Eloquent\Model)
  • hasNamedScope() - Determine if the model has a given scope. (defined in Illuminate\Database\Eloquent\Model)
  • is() - Determine if two models have the same ID and belong to the same table. (defined in Illuminate\Database\Eloquent\Model)
  • isClean() - Determine if the model or all the given attribute(s) have remained the same. (defined in Illuminate\Database\Eloquent\Model)
  • isDirty() - Determine if the model or any of the given attribute(s) have been modified. (defined in Illuminate\Database\Eloquent\Model)
  • isFillable() - Determine if the given attribute may be mass assigned. (defined in Illuminate\Database\Eloquent\Model)
  • isGuarded() - Determine if the given key is guarded. (defined in Illuminate\Database\Eloquent\Model)
  • isIgnoringTimestamps() - Determine if the given model is ignoring timestamps / touches. (defined in Illuminate\Database\Eloquent\Model)
  • isIgnoringTouch() - Determine if the given model is ignoring touches. (defined in Illuminate\Database\Eloquent\Model)
  • isNot() - Determine if two models are not the same. (defined in Illuminate\Database\Eloquent\Model)
  • isRelation() - Determine if the given key is a relationship method on the model. (defined in Illuminate\Database\Eloquent\Model)
  • isUnguarded() - Determine if the current state is "unguarded". (defined in Illuminate\Database\Eloquent\Model)
  • joiningTable() - Get the joining table name for a many-to-many relation. (defined in Illuminate\Database\Eloquent\Model)
  • joiningTableSegment() - Get this model's half of the intermediate table name for belongsToMany relationships. (defined in Illuminate\Database\Eloquent\Model)
  • jsonSerialize() - Convert the object into something JSON serializable. (defined in Illuminate\Database\Eloquent\Model)
  • load() - Eager load relations on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadAggregate() - Eager load relation's column aggregations on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadAvg() - Eager load relation average column values on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadCount() - Eager load relation counts on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadExists() - Eager load related model existence values on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMax() - Eager load relation max column values on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMin() - Eager load relation min column values on the model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMissing() - Eager load relations on the model if they are not already eager loaded. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorph() - Eager load relationships on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphAggregate() - Eager load relationship column aggregation on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphAvg() - Eager load relationship average column values on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphCount() - Eager load relationship counts on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphMax() - Eager load relationship max column values on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphMin() - Eager load relationship min column values on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadMorphSum() - Eager load relationship column summations on the polymorphic relation of a model. (defined in Illuminate\Database\Eloquent\Model)
  • loadSum() - Eager load relation's column summations on the model. (defined in Illuminate\Database\Eloquent\Model)
  • makeHidden() - Make the given, typically visible, attributes hidden. (defined in Illuminate\Database\Eloquent\Model)
  • makeHiddenIf() - Make the given, typically visible, attributes hidden if the given truth test passes. (defined in Illuminate\Database\Eloquent\Model)
  • makeVisible() - Make the given, typically hidden, attributes visible. (defined in Illuminate\Database\Eloquent\Model)
  • makeVisibleIf() - Make the given, typically hidden, attributes visible if the given truth test passes. (defined in Illuminate\Database\Eloquent\Model)
  • mergeCasts() - Merge new casts with existing casts on the model. (defined in Illuminate\Database\Eloquent\Model)
  • mergeFillable() - Merge new fillable attributes with existing fillable attributes on the model. (defined in Illuminate\Database\Eloquent\Model)
  • mergeGuarded() - Merge new guarded attributes with existing guarded attributes on the model. (defined in Illuminate\Database\Eloquent\Model)
  • newModelQuery() - Get a new query builder that doesn't have any global scopes or eager loading. (defined in Illuminate\Database\Eloquent\Model)
  • newQuery() - Get a new query builder for the model's table. (defined in Illuminate\Database\Eloquent\Model)
  • newQueryForRestoration() - Get a new query to restore one or more models by their queueable IDs. (defined in Illuminate\Database\Eloquent\Model)
  • newQueryWithoutRelationships() - Get a new query builder with no relationships loaded. (defined in Illuminate\Database\Eloquent\Model)
  • newQueryWithoutScope() - Get a new query instance without a given scope. (defined in Illuminate\Database\Eloquent\Model)
  • newQueryWithoutScopes() - Get a new query builder that doesn't have any global scopes. (defined in Illuminate\Database\Eloquent\Model)
  • observe() - Register observers with the model. (defined in Illuminate\Database\Eloquent\Model)
  • offsetExists() - Determine if the given attribute exists. (defined in Illuminate\Database\Eloquent\Model)
  • offsetGet() - Get the value for a given offset. (defined in Illuminate\Database\Eloquent\Model)
  • offsetSet() - Set the value for a given offset. (defined in Illuminate\Database\Eloquent\Model)
  • offsetUnset() - Unset the value for a given offset. (defined in Illuminate\Database\Eloquent\Model)
  • on() - Begin querying the model on a given connection. (defined in Illuminate\Database\Eloquent\Model)
  • onWriteConnection() - Begin querying the model on the write connection. (defined in Illuminate\Database\Eloquent\Model)
  • only() - Get a subset of the model's attributes. (defined in Illuminate\Database\Eloquent\Model)
  • originalIsEquivalent() - Determine if the new and old values for a given key are equivalent. (defined in Illuminate\Database\Eloquent\Model)
  • preventAccessingMissingAttributes() - Prevent accessing missing attributes on retrieved models. (defined in Illuminate\Database\Eloquent\Model)
  • preventLazyLoading() - Prevent model relationships from being lazy loaded. (defined in Illuminate\Database\Eloquent\Model)
  • preventSilentlyDiscardingAttributes() - Prevent non-fillable attributes from being silently discarded. (defined in Illuminate\Database\Eloquent\Model)
  • preventsAccessingMissingAttributes() - Determine if accessing missing attributes is disabled. (defined in Illuminate\Database\Eloquent\Model)
  • preventsLazyLoading() - Determine if lazy loading is disabled. (defined in Illuminate\Database\Eloquent\Model)
  • preventsSilentlyDiscardingAttributes() - Determine if discarding guarded attribute fills is disabled. (defined in Illuminate\Database\Eloquent\Model)
  • pushQuietly() - Save the model and all of its relationships without raising any events to the parent model. (defined in Illuminate\Database\Eloquent\Model)
  • qualifyColumn() - Qualify the given column name by the model's table. (defined in Illuminate\Database\Eloquent\Model)
  • qualifyColumns() - Qualify the given columns with the model's table. (defined in Illuminate\Database\Eloquent\Model)
  • query() - Begin querying the model. (defined in Illuminate\Database\Eloquent\Model)
  • refresh() - Reload the current model instance with fresh attributes from the database. (defined in Illuminate\Database\Eloquent\Model)
  • registerGlobalScopes() - Register the global scopes for this builder instance. (defined in Illuminate\Database\Eloquent\Model)
  • reguard() - Enable the mass assignment restrictions. (defined in Illuminate\Database\Eloquent\Model)
  • relationLoaded() - Determine if the given relation is loaded. (defined in Illuminate\Database\Eloquent\Model)
  • relationResolver() - Get the dynamic relation resolver if defined or inherited, or return null. (defined in Illuminate\Database\Eloquent\Model)
  • relationsToArray() - Get the model's relationships in array form. (defined in Illuminate\Database\Eloquent\Model)
  • removeObservableEvents() - Remove an observable event name. (defined in Illuminate\Database\Eloquent\Model)
  • replicate() - Clone the model into a new, non-existing instance. (defined in Illuminate\Database\Eloquent\Model)
  • replicateQuietly() - Clone the model into a new, non-existing instance without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • replicating() - Register a replicating model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • resolveChildRouteBinding() - Retrieve the child model for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • resolveConnection() - Resolve a connection instance. (defined in Illuminate\Database\Eloquent\Model)
  • resolveRelationUsing() - Define a dynamic relation resolver. (defined in Illuminate\Database\Eloquent\Model)
  • resolveRouteBinding() - Retrieve the model for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • resolveRouteBindingQuery() - Retrieve the model for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • resolveSoftDeletableChildRouteBinding() - Retrieve the child model for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • resolveSoftDeletableRouteBinding() - Retrieve the model for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • retrieved() - Register a retrieved model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • saveOrFail() - Save the model to the database within a transaction. (defined in Illuminate\Database\Eloquent\Model)
  • saveQuietly() - Save the model to the database without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • saved() - Register a saved model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • saving() - Register a saving model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • setAppends() - Set the accessors to append to model arrays. (defined in Illuminate\Database\Eloquent\Model)
  • setConnection() - Set the connection associated with the model. (defined in Illuminate\Database\Eloquent\Model)
  • setConnectionResolver() - Set the connection resolver instance. (defined in Illuminate\Database\Eloquent\Model)
  • setCreatedAt() - Set the value of the "created at" attribute. (defined in Illuminate\Database\Eloquent\Model)
  • setDateFormat() - Set the date format used by the model. (defined in Illuminate\Database\Eloquent\Model)
  • setEventDispatcher() - Set the event dispatcher instance. (defined in Illuminate\Database\Eloquent\Model)
  • setHidden() - Set the hidden attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • setIncrementing() - Set whether IDs are incrementing. (defined in Illuminate\Database\Eloquent\Model)
  • setKeyName() - Set the primary key for the model. (defined in Illuminate\Database\Eloquent\Model)
  • setKeyType() - Set the data type for the primary key. (defined in Illuminate\Database\Eloquent\Model)
  • setObservableEvents() - Set the observable event names. (defined in Illuminate\Database\Eloquent\Model)
  • setPerPage() - Set the number of models to return per page. (defined in Illuminate\Database\Eloquent\Model)
  • setRawAttributes() - Set the array of model attributes. No checking is done. (defined in Illuminate\Database\Eloquent\Model)
  • setRelation() - Set the given relationship on the model. (defined in Illuminate\Database\Eloquent\Model)
  • setRelations() - Set the entire relations array on the model. (defined in Illuminate\Database\Eloquent\Model)
  • setTable() - Set the table associated with the model. (defined in Illuminate\Database\Eloquent\Model)
  • setTouchedRelations() - Set the relationships that are touched on save. (defined in Illuminate\Database\Eloquent\Model)
  • setUpdatedAt() - Set the value of the "updated at" attribute. (defined in Illuminate\Database\Eloquent\Model)
  • setVisible() - Set the visible attributes for the model. (defined in Illuminate\Database\Eloquent\Model)
  • shouldBeStrict() - Indicate that models should prevent lazy loading, silently discarding attributes, and accessing missing attributes. (defined in Illuminate\Database\Eloquent\Model)
  • syncChanges() - Sync the changed attributes. (defined in Illuminate\Database\Eloquent\Model)
  • syncOriginal() - Sync the original attributes with the current. (defined in Illuminate\Database\Eloquent\Model)
  • syncOriginalAttribute() - Sync a single original attribute with its current value. (defined in Illuminate\Database\Eloquent\Model)
  • syncOriginalAttributes() - Sync multiple original attribute with their current values. (defined in Illuminate\Database\Eloquent\Model)
  • through() - Create a pending has-many-through or has-one-through relationship. (defined in Illuminate\Database\Eloquent\Model)
  • toArray() - Convert the model instance to an array. (defined in Illuminate\Database\Eloquent\Model)
  • toJson() - Convert the model instance to JSON. (defined in Illuminate\Database\Eloquent\Model)
  • totallyGuarded() - Determine if the model is totally guarded. (defined in Illuminate\Database\Eloquent\Model)
  • touch() - Update the model's update timestamp. (defined in Illuminate\Database\Eloquent\Model)
  • touchOwners() - Touch the owning relations of the model. (defined in Illuminate\Database\Eloquent\Model)
  • touchQuietly() - Update the model's update timestamp without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • touches() - Determine if the model touches a given relation. (defined in Illuminate\Database\Eloquent\Model)
  • unguard() - Disable all mass assignable restrictions. (defined in Illuminate\Database\Eloquent\Model)
  • unguarded() - Run the given callable while being unguarded. (defined in Illuminate\Database\Eloquent\Model)
  • unsetConnectionResolver() - Unset the connection resolver for models. (defined in Illuminate\Database\Eloquent\Model)
  • unsetEventDispatcher() - Unset the event dispatcher for models. (defined in Illuminate\Database\Eloquent\Model)
  • unsetRelation() - Unset a loaded relationship. (defined in Illuminate\Database\Eloquent\Model)
  • unsetRelations() - Unset all the loaded relations for the instance. (defined in Illuminate\Database\Eloquent\Model)
  • update() - Update the model in the database. (defined in Illuminate\Database\Eloquent\Model)
  • updateOrFail() - Update the model in the database within a transaction. (defined in Illuminate\Database\Eloquent\Model)
  • updateQuietly() - Update the model in the database without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • updateTimestamps() - Update the creation and update timestamps. (defined in Illuminate\Database\Eloquent\Model)
  • updated() - Register an updated model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • updating() - Register an updating model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • usesTimestamps() - Determine if the model uses timestamps. (defined in Illuminate\Database\Eloquent\Model)
  • wasChanged() - Determine if the model or any of the given attribute(s) were changed when the model was last saved. (defined in Illuminate\Database\Eloquent\Model)
  • with() - Begin querying a model with eager loading. (defined in Illuminate\Database\Eloquent\Model)
  • withoutBroadcasting() - Execute a callback without broadcasting any model events for all model types. (defined in Illuminate\Database\Eloquent\Model)
  • withoutEvents() - Execute a callback without firing any model events for any model type. (defined in Illuminate\Database\Eloquent\Model)
  • withoutRelations() - Duplicate the instance and unset all the loaded relations. (defined in Illuminate\Database\Eloquent\Model)
  • withoutTimestamps() - Disable timestamps for the current class during the given callback scope. (defined in Illuminate\Database\Eloquent\Model)
  • withoutTimestampsOn() - Disable timestamps for the given model classes during the given callback scope. (defined in Illuminate\Database\Eloquent\Model)
  • withoutTouching() - Disables relationship model touching for the current class during given callback scope. (defined in Illuminate\Database\Eloquent\Model)
  • withoutTouchingOn() - Disables relationship model touching for the given model classes during given callback scope. (defined in Illuminate\Database\Eloquent\Model)

Protected Methods

protected addJsonableAttributesToArray()

protected addJsonableAttributesToArray($attributes, $mutatedAttributes): array 

protected afterBoot()

protected afterBoot(): void

afterBoot is called after the model is constructed for the first time.

protected afterCreate()

protected afterCreate(): void

afterCreate handles the "created" model event

protected afterDelete()

protected afterDelete(): void

afterDelete handles the "deleted" model event

protected afterFetch()

protected afterFetch(): void

afterFetch handles the "fetched" model event

protected afterInit()

protected afterInit(): void

afterInit is called after the model is constructed, a nicer version of overriding the __construct method.

protected afterRelation()

protected afterRelation($name, $model): void

beforeRelation is fired on the relation model instance after it is created

protected afterSave()

protected afterSave(): void

afterSave handles the "saved" model event

protected afterUpdate()

protected afterUpdate(): void

afterUpdate handles the "updated" model event

protected asDateTime()

protected asDateTime(mixed $value): Carbon\Carbon 

asDateTime returns a timestamp as DateTime object.

protected beforeCreate()

protected beforeCreate(): void

beforeCreate handles the "creating" model event

protected beforeDelete()

protected beforeDelete(): void

beforeDelete handles the "deleting" model event

protected beforeFetch()

protected beforeFetch(): void

beforeFetch handles the "fetching" model event

protected beforeRelation()

protected beforeRelation($name, $relation): void

beforeRelation is fired on the relation object before it is created

protected beforeReplicate()

protected beforeReplicate(): void

protected beforeSave()

protected beforeSave(): void

beforeSave handles the "saving" model event

protected beforeUpdate()

protected beforeUpdate(): void

beforeUpdate handles the "updating" model event

protected bootNicerEvents()

protected bootNicerEvents(): void

bootNicerEvents to this model, in the format of method overrides.

protected commitDeferredAfter()

protected commitDeferredAfter($sessionKey): void

commitDeferredAfter is used internally to commit all deferred bindings after saving

protected commitDeferredBefore()

protected commitDeferredBefore($sessionKey): void

commitDeferredBefore is used internally to commit all deferred bindings before saving. It is a rare need to have to call this, since it only applies to the "belongs to" relationship which generally does not need deferring.

protected commitDeferredOfType()

protected commitDeferredOfType($sessionKey, $include = null, $exclude = null): void

commitDeferredOfType is an internal method for committing deferred relations

protected emitterEventSortEvents()

protected emitterEventSortEvents($eventName, $combined = []): array 

emitterEventSortEvents sorts the listeners for a given event by priority

protected extendableIsAccessible()

protected extendableIsAccessible(
    mixed $class,
    string $propertyName
): boolean 

extendableIsAccessible checks if a property is accessible, property equivalent of is_callable()

protected extendableIsSettingDynamicProperty()

protected extendableIsSettingDynamicProperty(): bool 

extendableIsSettingDynamicProperty returns true if a dynamic property action is taking place

protected extensionExtractImplements()

protected extensionExtractImplements(): array 

extensionExtractImplements will return classes to implement.

protected extensionExtractMethods()

protected extensionExtractMethods(
    string $extensionName,
    object $extensionObject
): void 

extensionExtractMethods extracts the available methods from a behavior and adds it to the list of callable methods

protected getDeferrableRelationTypes()

protected getDeferrableRelationTypes(): array 

getDeferrableRelationTypes returns all possible relation types that can be deferred

protected getDeferredBindingRecords()

protected getDeferredBindingRecords(
    $sessionKey
): October\Rain\Database\Collection 

getDeferredBindingRecords returns any outstanding binding records for this model

protected getExtendableMethodFromDynamicMethods()

protected getExtendableMethodFromDynamicMethods($name): callable|null 

protected getExtendableMethodFromExtensions()

protected getExtendableMethodFromExtensions($name): array|null 

protected getRelationCaller()

protected getRelationCaller(): void

getRelationCaller finds the calling function name from the stack trace.

protected getRelationCustomClass()

protected getRelationCustomClass($name): string|null 

getRelationCustomClass returns a custom relation class name for the relation or null if none is found.

protected getRelationDefaults()

protected getRelationDefaults(string $type): array 

getRelationDefaults returns default relation arguments for a given type.

protected handleRelation()

protected handleRelation(
    string $relationName
): Illuminate\Database\Eloquent\Relations\Relation 

handleRelation looks for the relation and does the correct magic as Eloquent would require inside relation methods. For more information, read the documentation of the mentioned property.

protected initializeModelEvent()

protected initializeModelEvent(): void

initializeModelEvent is called every time the model is constructed.

protected makeRelationInternal()

protected makeRelationInternal($relationName, $relationClass): void

makeRelationInternal is used internally to create a new related instance. It also fires the afterRelation to extend the created instance.

protected morphEagerTo()

protected morphEagerTo(
    string $name,
    string $type,
    string $id,
    string $ownerKey
): Illuminate\Database\Eloquent\Relations\MorphTo 

morphEagerTo defines a polymorphic, inverse one-to-one or many relationship.

protected morphInstanceTo()

protected morphInstanceTo(
    string $target,
    string $name,
    string $type,
    string $id,
    string $ownerKey
): Illuminate\Database\Eloquent\Relations\MorphTo 

morphInstanceTo defines a polymorphic, inverse one-to-one or many relationship

protected newBaseQueryBuilder()

protected newBaseQueryBuilder(): October\Rain\Database\QueryBuilder 

newBaseQueryBuilder instance for the connection.

protected performDeleteOnModel()

protected performDeleteOnModel(): void

performDeleteOnModel performs the actual delete query on this model instance.

protected performDeleteOnRelations()

protected performDeleteOnRelations(): void

performDeleteOnRelations locates relations with delete flag and cascades the delete event. This is called before the parent model is deleted. This method checks in with the Multisite trait to preserve shared relations.

See Also

protected saveInternal()

protected saveInternal(array $options = []): bool 

saveInternal is an internal method that saves the model to the database. This is used by {@link save()} and {@link forceSave()}.

protected setRelationSimpleValue()

protected setRelationSimpleValue($relationName, $value): void

setRelationSimpleValue sets a relation value directly from its attribute.

protected validateRelationArgs()

protected validateRelationArgs($relationName, $optional, $required = []): void

validateRelationArgs supplied relation arguments

Show inherited protected methods

Inherited Protected Methods

  • addCastAttributesToArray() - Add the casted attributes to the attributes array. (defined in Illuminate\Database\Eloquent\Model)
  • addDateAttributesToArray() - Add the date attributes to the attributes array. (defined in Illuminate\Database\Eloquent\Model)
  • addMutatedAttributesToArray() - Add the mutated attributes to the attributes array. (defined in Illuminate\Database\Eloquent\Model)
  • asDate() - Return a timestamp as DateTime object with time set to 00:00:00. (defined in Illuminate\Database\Eloquent\Model)
  • asDecimal() - Return a decimal as string. (defined in Illuminate\Database\Eloquent\Model)
  • asJson() - Encode the given value as JSON. (defined in Illuminate\Database\Eloquent\Model)
  • asTimestamp() - Return a timestamp as unix timestamp. (defined in Illuminate\Database\Eloquent\Model)
  • boot() - Bootstrap the model and its traits. (defined in Illuminate\Database\Eloquent\Model)
  • bootIfNotBooted() - Check if the model needs to be booted and if so, do it. (defined in Illuminate\Database\Eloquent\Model)
  • bootTraits() - Boot all of the bootable traits on the model. (defined in Illuminate\Database\Eloquent\Model)
  • booted() - Perform any actions required after the model boots. (defined in Illuminate\Database\Eloquent\Model)
  • booting() - Perform any actions required before the model boots. (defined in Illuminate\Database\Eloquent\Model)
  • castAttribute() - Cast an attribute to a native PHP type. (defined in Illuminate\Database\Eloquent\Model)
  • castAttributeAsEncryptedString() - Cast the given attribute to an encrypted string. (defined in Illuminate\Database\Eloquent\Model)
  • castAttributeAsJson() - Cast the given attribute to JSON. (defined in Illuminate\Database\Eloquent\Model)
  • childRouteBindingRelationshipName() - Retrieve the child route model binding relationship name for the given child type. (defined in Illuminate\Database\Eloquent\Model)
  • decrement() - Decrement a column's value by a given amount. (defined in Illuminate\Database\Eloquent\Model)
  • decrementQuietly() - Decrement a column's value by a given amount without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • deviateClassCastableAttribute() - Increment or decrement the given attribute using the custom cast class. (defined in Illuminate\Database\Eloquent\Model)
  • fillableFromArray() - Get the fillable attributes of a given array. (defined in Illuminate\Database\Eloquent\Model)
  • filterModelEventResults() - Filter the model event results. (defined in Illuminate\Database\Eloquent\Model)
  • finishSave() - Perform any actions that are necessary after the model is saved. (defined in Illuminate\Database\Eloquent\Model)
  • fireCustomModelEvent() - Fire a custom model event for the given event. (defined in Illuminate\Database\Eloquent\Model)
  • fireModelEvent() - Fire the given event for the model. (defined in Illuminate\Database\Eloquent\Model)
  • forwardCallTo() - Forward a method call to the given object. (defined in Illuminate\Database\Eloquent\Model)
  • forwardDecoratedCallTo() - Forward a method call to the given object, returning $this if the forwarded call returned itself. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayAttributeByKey() - Get an array attribute or return an empty array if it is not set. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayAttributeWithValue() - Get an array attribute with the given key and value set. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayableAppends() - Get all of the appendable values that are arrayable. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayableAttributes() - Get an attribute array of all arrayable attributes. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayableItems() - Get an attribute array of all arrayable values. (defined in Illuminate\Database\Eloquent\Model)
  • getArrayableRelations() - Get an attribute array of all arrayable relations. (defined in Illuminate\Database\Eloquent\Model)
  • getAttributeFromArray() - Get an attribute from the $attributes array. (defined in Illuminate\Database\Eloquent\Model)
  • getAttributeMarkedMutatorMethods() - Get all of the "Attribute" return typed attribute mutator methods. (defined in Illuminate\Database\Eloquent\Model)
  • getAttributesForInsert() - Get all of the current attributes on the model for an insert operation. (defined in Illuminate\Database\Eloquent\Model)
  • getCastType() - Get the type of cast for a model attribute. (defined in Illuminate\Database\Eloquent\Model)
  • getClassCastableAttributeValue() - Cast the given attribute using a custom cast class. (defined in Illuminate\Database\Eloquent\Model)
  • getEnumCaseFromValue() - Get an enum case instance from a given class and value. (defined in Illuminate\Database\Eloquent\Model)
  • getEnumCastableAttributeValue() - Cast the given attribute to an enum. (defined in Illuminate\Database\Eloquent\Model)
  • getKeyForSaveQuery() - Get the primary key value for a save query. (defined in Illuminate\Database\Eloquent\Model)
  • getKeyForSelectQuery() - Get the primary key value for a select query. (defined in Illuminate\Database\Eloquent\Model)
  • getMorphs() - Get the polymorphic relationship columns. (defined in Illuminate\Database\Eloquent\Model)
  • getMutatorMethods() - Get all of the attribute mutator methods. (defined in Illuminate\Database\Eloquent\Model)
  • getOriginalWithoutRewindingModel() - Get the model's original attribute values. (defined in Illuminate\Database\Eloquent\Model)
  • getRelationshipFromMethod() - Get a relationship value from a method. (defined in Illuminate\Database\Eloquent\Model)
  • getStorableEnumValue() - Get the storable value from the given enum. (defined in Illuminate\Database\Eloquent\Model)
  • guessBelongsToManyRelation() - Get the relationship name of the belongsToMany relationship. (defined in Illuminate\Database\Eloquent\Model)
  • guessBelongsToRelation() - Guess the "belongs to" relationship name. (defined in Illuminate\Database\Eloquent\Model)
  • handleLazyLoadingViolation() - Handle a lazy loading violation. (defined in Illuminate\Database\Eloquent\Model)
  • hasChanges() - Determine if any of the given attributes were changed when the model was last saved. (defined in Illuminate\Database\Eloquent\Model)
  • increment() - Increment a column's value by a given amount. (defined in Illuminate\Database\Eloquent\Model)
  • incrementOrDecrement() - Run the increment or decrement method on the model. (defined in Illuminate\Database\Eloquent\Model)
  • incrementQuietly() - Increment a column's value by a given amount without raising any events. (defined in Illuminate\Database\Eloquent\Model)
  • initializeTraits() - Initialize any initializable traits on the model. (defined in Illuminate\Database\Eloquent\Model)
  • insertAndSetId() - Insert the given attributes and set the ID on the model. (defined in Illuminate\Database\Eloquent\Model)
  • isClassCastable() - Determine if the given key is cast using a custom class. (defined in Illuminate\Database\Eloquent\Model)
  • isClassDeviable() - Determine if the key is deviable using a custom class. (defined in Illuminate\Database\Eloquent\Model)
  • isClassSerializable() - Determine if the key is serializable using a custom class. (defined in Illuminate\Database\Eloquent\Model)
  • isCustomDateTimeCast() - Determine if the cast type is a custom date time cast. (defined in Illuminate\Database\Eloquent\Model)
  • isDateAttribute() - Determine if the given attribute is a date or date castable. (defined in Illuminate\Database\Eloquent\Model)
  • isDateCastable() - Determine whether a value is Date / DateTime castable for inbound manipulation. (defined in Illuminate\Database\Eloquent\Model)
  • isDateCastableWithCustomFormat() - Determine whether a value is Date / DateTime custom-castable for inbound manipulation. (defined in Illuminate\Database\Eloquent\Model)
  • isDecimalCast() - Determine if the cast type is a decimal cast. (defined in Illuminate\Database\Eloquent\Model)
  • isEncryptedCastable() - Determine whether a value is an encrypted castable for inbound manipulation. (defined in Illuminate\Database\Eloquent\Model)
  • isEnumCastable() - Determine if the given key is cast using an enum. (defined in Illuminate\Database\Eloquent\Model)
  • isGuardableColumn() - Determine if the given column is a valid, guardable column. (defined in Illuminate\Database\Eloquent\Model)
  • isImmutableCustomDateTimeCast() - Determine if the cast type is an immutable custom date time cast. (defined in Illuminate\Database\Eloquent\Model)
  • isJsonCastable() - Determine whether a value is JSON castable for inbound manipulation. (defined in Illuminate\Database\Eloquent\Model)
  • isStandardDateFormat() - Determine if the given value is a standard date format. (defined in Illuminate\Database\Eloquent\Model)
  • mergeAttributesFromAttributeCasts() - Merge the cast class attributes back into the model. (defined in Illuminate\Database\Eloquent\Model)
  • mergeAttributesFromCachedCasts() - Merge the cast class and attribute cast attributes back into the model. (defined in Illuminate\Database\Eloquent\Model)
  • mergeAttributesFromClassCasts() - Merge the cast class attributes back into the model. (defined in Illuminate\Database\Eloquent\Model)
  • mutateAttribute() - Get the value of an attribute using its mutator. (defined in Illuminate\Database\Eloquent\Model)
  • mutateAttributeForArray() - Get the value of an attribute using its mutator for array conversion. (defined in Illuminate\Database\Eloquent\Model)
  • mutateAttributeMarkedAttribute() - Get the value of an "Attribute" return type marked attribute using its mutator. (defined in Illuminate\Database\Eloquent\Model)
  • newBelongsTo() - Instantiate a new BelongsTo relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newBelongsToMany() - Instantiate a new BelongsToMany relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newHasMany() - Instantiate a new HasMany relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newHasManyThrough() - Instantiate a new HasManyThrough relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newHasOne() - Instantiate a new HasOne relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newHasOneThrough() - Instantiate a new HasOneThrough relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newMorphMany() - Instantiate a new MorphMany relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newMorphOne() - Instantiate a new MorphOne relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newMorphTo() - Instantiate a new MorphTo relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newMorphToMany() - Instantiate a new MorphToMany relationship. (defined in Illuminate\Database\Eloquent\Model)
  • newRelatedInstance() - Create a new model instance for a related model. (defined in Illuminate\Database\Eloquent\Model)
  • newRelatedThroughInstance() - Create a new model instance for a related "through" model. (defined in Illuminate\Database\Eloquent\Model)
  • normalizeCastClassResponse() - Normalize the response from a custom class caster. (defined in Illuminate\Database\Eloquent\Model)
  • parseCasterClass() - Parse the given caster class, removing any arguments. (defined in Illuminate\Database\Eloquent\Model)
  • performInsert() - Perform a model insert operation. (defined in Illuminate\Database\Eloquent\Model)
  • performUpdate() - Perform a model update operation. (defined in Illuminate\Database\Eloquent\Model)
  • registerModelEvent() - Register a model event with the dispatcher. (defined in Illuminate\Database\Eloquent\Model)
  • registerObserver() - Register a single observer with the model. (defined in Illuminate\Database\Eloquent\Model)
  • resolveCasterClass() - Resolve the custom caster class for a given key. (defined in Illuminate\Database\Eloquent\Model)
  • resolveChildRouteBindingQuery() - Retrieve the child model query for a bound value. (defined in Illuminate\Database\Eloquent\Model)
  • serializeClassCastableAttribute() - Serialize the given attribute using the custom cast class. (defined in Illuminate\Database\Eloquent\Model)
  • serializeDate() - Prepare a date for array / JSON serialization. (defined in Illuminate\Database\Eloquent\Model)
  • setAttributeMarkedMutatedAttributeValue() - Set the value of a "Attribute" return type marked attribute using its mutator. (defined in Illuminate\Database\Eloquent\Model)
  • setClassCastableAttribute() - Set the value of a class castable attribute. (defined in Illuminate\Database\Eloquent\Model)
  • setEnumCastableAttribute() - Set the value of an enum castable attribute. (defined in Illuminate\Database\Eloquent\Model)
  • setKeysForSaveQuery() - Set the keys for a save update query. (defined in Illuminate\Database\Eloquent\Model)
  • setKeysForSelectQuery() - Set the keys for a select query. (defined in Illuminate\Database\Eloquent\Model)
  • setMutatedAttributeValue() - Set the value of an attribute using its mutator. (defined in Illuminate\Database\Eloquent\Model)
  • throwBadMethodCallException() - Throw a bad method call exception for the given method. (defined in Illuminate\Database\Eloquent\Model)
  • throwMissingAttributeExceptionIfApplicable() - Either throw a missing attribute exception or return null depending on Eloquent's configuration. (defined in Illuminate\Database\Eloquent\Model)
  • transformModelValue() - Transform a raw model value using mutators, casts, etc. (defined in Illuminate\Database\Eloquent\Model)