Methods |
public
|
attributesToArray(): array
Convert the model's attributes to an array.
Convert the model's attributes to an array.
|
#
|
public
|
relationsToArray(): array
Get the model's relationships in array form.
Get the model's relationships in array form.
|
#
|
public
|
getAttribute(string $key): mixed
Get an attribute from the model.
Get an attribute from the model.
|
#
|
public
|
getAttributeValue(string $key): mixed
Get a plain attribute (not a relationship).
Get a plain attribute (not a relationship).
|
#
|
public
|
getRelationValue(string $key): mixed
Get a relationship.
|
#
|
public
|
isRelation(string $key): bool
Determine if the given key is a relationship method on the model.
Determine if the given key is a relationship method on the model.
|
#
|
public
|
hasGetMutator(string $key): bool
Determine if a get mutator exists for an attribute.
Determine if a get mutator exists for an attribute.
|
#
|
public
|
hasAttributeMutator(string $key): bool
Determine if a "Attribute" return type marked mutator exists for an attribute.
Determine if a "Attribute" return type marked mutator exists for an attribute.
|
#
|
public
|
hasAttributeGetMutator(string $key): bool
Determine if a "Attribute" return type marked get mutator exists for an attribute.
Determine if a "Attribute" return type marked get mutator exists for an attribute.
|
#
|
public
|
mergeCasts(array $casts): $this
Merge new casts with existing casts on the model.
Merge new casts with existing casts on the model.
|
#
|
public
|
setAttribute(string $key, mixed $value): mixed
Set a given attribute on the model.
Set a given attribute on the model.
|
#
|
public
|
hasSetMutator(string $key): bool
Determine if a set mutator exists for an attribute.
Determine if a set mutator exists for an attribute.
|
#
|
public
|
hasAttributeSetMutator(string $key): bool
Determine if an "Attribute" return type marked set mutator exists for an attribute.
Determine if an "Attribute" return type marked set mutator exists for an attribute.
|
#
|
public
|
fillJsonAttribute(string $key, mixed $value): $this
Set a given JSON attribute on the model.
Set a given JSON attribute on the model.
|
#
|
public
|
fromJson(string $value, bool $asObject = false): mixed
Decode the given JSON back into an array or object.
Decode the given JSON back into an array or object.
|
#
|
public
|
fromEncryptedString(string $value): mixed
Decrypt the given encrypted string.
Decrypt the given encrypted string.
|
#
|
public
static
|
encryptUsing(Encrypter $encrypter): void
Set the encrypter instance that will be used to encrypt attributes.
Set the encrypter instance that will be used to encrypt attributes.
|
#
|
public
|
fromFloat(mixed $value): mixed
Decode the given float.
|
#
|
public
|
fromDateTime(mixed $value): string|null
Convert a DateTime to a storable string.
Convert a DateTime to a storable string.
|
#
|
public
|
getDates(): array
Get the attributes that should be converted to dates.
Get the attributes that should be converted to dates.
|
#
|
public
|
getDateFormat(): string
Get the format for database stored dates.
Get the format for database stored dates.
|
#
|
public
|
setDateFormat(string $format): $this
Set the date format used by the model.
Set the date format used by the model.
|
#
|
public
|
hasCast(string $key, array|string|null $types = null): bool
Determine whether an attribute should be cast to a native type.
Determine whether an attribute should be cast to a native type.
|
#
|
public
|
getCasts(): array
Get the casts array.
|
#
|
public
|
getAttributes(): array
Get all of the current attributes on the model.
Get all of the current attributes on the model.
|
#
|
public
|
setRawAttributes(array $attributes, bool $sync = false): $this
Set the array of model attributes. No checking is done.
Set the array of model attributes. No checking is done.
|
#
|
public
|
getOriginal(string|null $key = null, mixed $default = null): mixed|array
Get the model's original attribute values.
Get the model's original attribute values.
|
#
|
public
|
getRawOriginal(string|null $key = null, mixed $default = null): mixed|array
Get the model's raw original attribute values.
Get the model's raw original attribute values.
|
#
|
public
|
only(array|mixed $attributes): array
Get a subset of the model's attributes.
Get a subset of the model's attributes.
|
#
|
public
|
syncOriginal(): $this
Sync the original attributes with the current.
Sync the original attributes with the current.
|
#
|
public
|
syncOriginalAttribute(string $attribute): $this
Sync a single original attribute with its current value.
Sync a single original attribute with its current value.
|
#
|
public
|
syncOriginalAttributes(array|string $attributes): $this
Sync multiple original attribute with their current values.
Sync multiple original attribute with their current values.
|
#
|
public
|
syncChanges(): $this
Sync the changed attributes.
Sync the changed attributes.
|
#
|
public
|
isDirty(array|string|null $attributes = null): bool
Determine if the model or any of the given attribute(s) have been modified.
Determine if the model or any of the given attribute(s) have been modified.
|
#
|
public
|
isClean(array|string|null $attributes = null): bool
Determine if the model or all the given attribute(s) have remained the same.
Determine if the model or all the given attribute(s) have remained the same.
|
#
|
public
|
wasChanged(array|string|null $attributes = null): bool
Determine if the model or any of the given attribute(s) have been modified.
Determine if the model or any of the given attribute(s) have been modified.
|
#
|
public
|
getDirty(): array
Get the attributes that have been changed since the last sync.
Get the attributes that have been changed since the last sync.
|
#
|
public
|
getChanges(): array
Get the attributes that were changed.
Get the attributes that were changed.
|
#
|
public
|
originalIsEquivalent(string $key): bool
Determine if the new and old values for a given key are equivalent.
Determine if the new and old values for a given key are equivalent.
|
#
|
public
|
append(array|string $attributes): $this
Append attributes to query when building a query.
Append attributes to query when building a query.
|
#
|
public
|
setAppends(array $appends): $this
Set the accessors to append to model arrays.
Set the accessors to append to model arrays.
|
#
|
public
|
hasAppended(string $attribute): bool
Return whether the accessor attribute has been appended.
Return whether the accessor attribute has been appended.
|
#
|
public
|
getMutatedAttributes(): array
Get the mutated attributes for a given instance.
Get the mutated attributes for a given instance.
|
#
|
public
static
|
cacheMutatedAttributes(string $class): void
Extract and cache all the mutated attributes of a class.
Extract and cache all the mutated attributes of a class.
|
#
|