trait SerializesAndRestoresModelIdentifiers

Methods

mixed
getSerializedPropertyValue(mixed $value, bool $withRelations = true)

Get the property value prepared for serialization.

mixed
getRestoredPropertyValue(mixed $value)

Get the restored property value after deserialization.

restoreCollection(ModelIdentifier $value)

Restore a queueable collection instance.

restoreModel(ModelIdentifier $value)

Restore the model from the model identifier instance.

getQueryForModelRestoration(Model $model, array|int|string $ids)

Get the query for model restoration.

Details

at line 20
protected mixed getSerializedPropertyValue(mixed $value, bool $withRelations = true)

Get the property value prepared for serialization.

Parameters

mixed $value
bool $withRelations

Return Value

mixed

at line 54
protected mixed getRestoredPropertyValue(mixed $value)

Get the restored property value after deserialization.

Parameters

mixed $value

Return Value

mixed

at line 68
protected Collection restoreCollection(ModelIdentifier $value)

Restore a queueable collection instance.

Parameters

ModelIdentifier $value

Return Value

Collection

at line 109
Model restoreModel(ModelIdentifier $value)

Restore the model from the model identifier instance.

Parameters

ModelIdentifier $value

Return Value

Model

at line 123
protected Builder getQueryForModelRestoration(Model $model, array|int|string $ids)

Get the query for model restoration.

Parameters

Model $model
array|int|string $ids

Return Value

Builder