class AsHtmlString implements Castable

Methods

castUsing(array $arguments)

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

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

Cast the stored value to an HTML string.

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

Prepare the HTML string for storage.

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

Serialize the HTML string for an array or JSON response.

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
HtmlString|null get(Model $model, string $key, mixed $value, array $attributes)

Cast the stored value to an HTML string.

Parameters

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

Return Value

HtmlString|null

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

Prepare the HTML string for storage.

Parameters

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

Return Value

string|null

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

Serialize the HTML string for an array or JSON response.

Parameters

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

Return Value

string|null