AsArrayObject
class AsArrayObject implements Castable
Methods
static CastsAttributes|CastsInboundAttributes|string
castUsing(array $arguments)
Get the caster class to use when casting from / to this cast target.
__construct(array $arguments)
Create a new array object cast instance.
ArrayObject|null
array
bool
shouldCacheObject(Model $model, string $key, object $value)
Determine if the assigned object can be cached as the attribute value.
Details
at line 21
static CastsAttributes|CastsInboundAttributes|string
castUsing(array $arguments)
Get the caster class to use when casting from / to this cast target.
at line 27
__construct(array $arguments)
Create a new array object cast instance.
at line 34
ArrayObject|null
get(Model $model, string $key, mixed $value, array $attributes)
Transform the attribute from the underlying model values.
at line 48
array
set(Model $model, string $key, mixed $value, array $attributes)
Transform the attribute to its underlying model values.
at line 69
bool
shouldCacheObject(Model $model, string $key, object $value)
Determine if the assigned object can be cached as the attribute value.
at line 77
array
serialize(Model $model, string $key, mixed $value, array $attributes)
Serialize the attribute for an array or JSON response.