Documentation

ConditionallyLoadsAttributes

Table of Contents

attributes()  : MergeValue
Merge the given attributes.
filter()  : array<string|int, mixed>
Filter the given data, removing any optional values.
merge()  : array<string|int, mixed>
Merge the given data in at the given index.
mergeWhen()  : MissingValue|mixed
Merge a value based on a given condition.
transform()  : mixed
Transform the given value if it is present.
when()  : MissingValue|mixed
Retrieve a value based on a given condition.
whenLoaded()  : MissingValue|mixed
Retrieve a relationship if it has been loaded.
whenPivotLoaded()  : MissingValue|mixed
Execute a callback if the given pivot table has been loaded.

Methods

filter()

Filter the given data, removing any optional values.

protected filter(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

merge()

Merge the given data in at the given index.

protected merge(array<string|int, mixed> $data, int $index, array<string|int, mixed> $merge) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
$index : int
$merge : array<string|int, mixed>
Return values
array<string|int, mixed>

transform()

Transform the given value if it is present.

protected transform(mixed $value, callable $callback[, mixed $default = null ]) : mixed
Parameters
$value : mixed
$callback : callable
$default : mixed = null
Return values
mixed

when()

Retrieve a value based on a given condition.

protected when(bool $condition, mixed $value[, mixed $default = null ]) : MissingValue|mixed
Parameters
$condition : bool
$value : mixed
$default : mixed = null
Return values
MissingValue|mixed

whenLoaded()

Retrieve a relationship if it has been loaded.

protected whenLoaded(string $relationship[, mixed $value = null ][, mixed $default = null ]) : MissingValue|mixed
Parameters
$relationship : string
$value : mixed = null
$default : mixed = null
Return values
MissingValue|mixed

whenPivotLoaded()

Execute a callback if the given pivot table has been loaded.

protected whenPivotLoaded(string $table, mixed $value[, mixed $default = null ]) : MissingValue|mixed
Parameters
$table : string
$value : mixed
$default : mixed = null
Return values
MissingValue|mixed

Search results