HasNestedAttributes
Trait HasNestedAttributes.
Tags
Table of Contents
Properties
- $nestedAttributes : array<string|int, string>
- $nestedAttributesFor : array<string|int, mixed>
- Defined nested attributes.
Methods
- fill() : static
- Fill the model with an array of attributes.
- getNestedAttributesFor() : array<string|int, mixed>
- Get accept nested attributes.
- save() : bool
- Save the model to the database.
- syncHasManyRelationAttribute() : bool
- Save the hasMany nested relation attributes to the database.
- syncHasOneRelationAttribute() : bool
- allowDestroyNestedAttributes() : bool
- Check can we delete nested data.
Properties
$nestedAttributes
public
array<string|int, string>
$nestedAttributes
$nestedAttributesFor
Defined nested attributes.
protected
array<string|int, mixed>
$nestedAttributesFor
= []
Methods
fill()
Fill the model with an array of attributes.
public
fill(array<string|int, mixed> $attributes) : static
Parameters
- $attributes : array<string|int, mixed>
Tags
Return values
staticgetNestedAttributesFor()
Get accept nested attributes.
public
getNestedAttributesFor() : array<string|int, mixed>
Return values
array<string|int, mixed>save()
Save the model to the database.
public
save([array<string|int, mixed> $options = [] ]) : bool
Parameters
- $options : array<string|int, mixed> = []
Tags
Return values
boolsyncHasManyRelationAttribute()
Save the hasMany nested relation attributes to the database.
public
syncHasManyRelationAttribute(HasMany $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasMany
- $params : array<string|int, mixed>
Return values
boolsyncHasOneRelationAttribute()
public
syncHasOneRelationAttribute(HasOne $relation, array<string|int, mixed> $params) : bool
Parameters
- $relation : HasOne
- $params : array<string|int, mixed>
Return values
boolallowDestroyNestedAttributes()
Check can we delete nested data.
protected
allowDestroyNestedAttributes(array<string|int, mixed> $params) : bool
Parameters
- $params : array<string|int, mixed>