class AutoWhenLoadedLazy extends AutoLazy

Methods

build(Closure $castValue, mixed $payload, DataProperty $property, mixed $value)

Build an automatic lazy value for a loaded relation.

__construct(string|null $relation = null)

Create a new automatic relation lazy attribute.

string
forRelation(DataProperty $property)

Get the relation represented by the property.

Details

at line 27
Lazy build(Closure $castValue, mixed $payload, DataProperty $property, mixed $value)

Build an automatic lazy value for a loaded relation.

Parameters

Closure $castValue
mixed $payload
DataProperty $property
mixed $value

Return Value

Lazy

at line 19
__construct(string|null $relation = null)

Create a new automatic relation lazy attribute.

Parameters

string|null $relation

at line 39
string forRelation(DataProperty $property)

Get the relation represented by the property.

Parameters

DataProperty $property

Return Value

string