AsEnumCollection
class AsEnumCollection implements Castable
Properties
| protected array | $arguments |
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 enum collection cast instance.
Collection|null
array
bool
shouldCacheObject(Model $model, string $key, object $value)
Determine if the assigned object can be cached as the attribute value.
array
string|int
getStorableEnumValue(mixed $enum)
Get the storable value of the given enum.
Details
at line 28
static CastsAttributes|CastsInboundAttributes|string
castUsing(array $arguments)
Get the caster class to use when casting from / to this cast target.
at line 36
__construct(array $arguments)
Create a new enum collection cast instance.
at line 44
Collection|null
get(Model $model, string $key, mixed $value, array $attributes)
Transform the attribute from the underlying model values.
at line 68
array
set(Model $model, string $key, mixed $value, array $attributes)
Transform the attribute to its underlying model values.
at line 86
bool
shouldCacheObject(Model $model, string $key, object $value)
Determine if the assigned object can be cached as the attribute value.
at line 96
array
serialize(Model $model, string $key, mixed $value, array $attributes)
Serialize the attribute for an array or JSON response.
at line 106
protected string|int
getStorableEnumValue(mixed $enum)
Get the storable value of the given enum.