class AsStringable implements Castable

Methods

castUsing(array $arguments)

Get the caster class to use when casting from / to this cast target.

Stringable|null
get(Model $model, string $key, mixed $value, array $attributes)

Cast the stored value to a stringable instance.

string|null
set(Model $model, string $key, mixed $value, array $attributes)

Prepare the stringable value for storage.

bool
shouldCacheObject(Model $model, string $key, object $value)

Determine if the assigned object can be cached as the attribute value.

Details

at line 20
static CastsAttributes|CastsInboundAttributes|string castUsing(array $arguments)

Get the caster class to use when casting from / to this cast target.

Parameters

array $arguments

Return Value

CastsAttributes|CastsInboundAttributes|string

at line 26
Stringable|null get(Model $model, string $key, mixed $value, array $attributes)

Cast the stored value to a stringable instance.

Parameters

Model $model
string $key
mixed $value
array $attributes

Return Value

Stringable|null

at line 34
string|null set(Model $model, string $key, mixed $value, array $attributes)

Prepare the stringable value for storage.

Parameters

Model $model
string $key
mixed $value
array $attributes

Return Value

string|null

at line 42
bool shouldCacheObject(Model $model, string $key, object $value)

Determine if the assigned object can be cached as the attribute value.

Parameters

Model $model
string $key
object $value

Return Value

bool