Repository
class Repository (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected Dispatcher | $events | The event dispatcher instance. |
|
protected array<string,mixed> | $data | The contextual data. |
|
protected array<string,mixed> | The hidden contextual data. |
||
static protected callable|null | $handleUnserializeExceptionsUsing | The callback that should handle unserialize exceptions. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Get the property value prepared for serialization.
Get the restored property value after deserialization.
Get the query for model restoration.
Determine if the given key exists.
Determine if the given key is missing.
Determine if the given key exists within the hidden context data.
Determine if the given key is missing within the hidden context data.
Retrieve all the context data.
Retrieve all the hidden context data.
Retrieve the given key's value.
Retrieve the given key's hidden value.
Retrieve the given key's value and then forget it.
Retrieve the given key's hidden value and then forget it.
Retrieve only the values of the given keys.
Retrieve only the hidden values of the given keys.
Add a context value.
Add a hidden context value.
Forget the given context key.
Forget the given hidden context key.
Add a context value if it does not exist yet.
Add a hidden context value if it does not exist yet.
Push the given values onto the key's stack.
Pop the latest value from the key's stack.
Push the given hidden values onto the key's stack.
Pop the latest hidden value from the key's stack.
Increment a context counter.
Decrement a context counter.
Determine if the given value is in the given stack.
Determine if the given value is in the given hidden stack.
Determine if a given key can be used as a stack.
Determine if a given key can be used as a hidden stack.
Run the callback function with the given context values and restore the original context state when complete.
Determine if the repository is empty.
Execute the given callback when context is about to be dehydrated.
Execute the given callback when context has been hydrated.
Handle unserialize exceptions using the given callback.
Flush all context data.
Dehydrate the context data.
Hydrate the context instance.
Details
$this|TWhenReturnType
when($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
$this|TUnlessReturnType
unless($value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
protected mixed
getSerializedPropertyValue(mixed $value, bool $withRelations = true)
Get the property value prepared for serialization.
protected mixed
getRestoredPropertyValue(mixed $value)
Get the restored property value after deserialization.
protected Collection
restoreCollection(ModelIdentifier $value)
Restore a queueable collection instance.
protected TModel>
getQueryForModelRestoration(TModel $model, array|int $ids)
Get the query for model restoration.
protected mixed
getPropertyValue(ReflectionProperty $property)
Get the property value for the given property.
bool
missingHidden(string $key)
Determine if the given key is missing within the hidden context data.
mixed
pullHidden(string $key, mixed $default = null)
Retrieve the given key's hidden value and then forget it.
array<string,mixed>
onlyHidden(array<int,string> $keys)
Retrieve only the hidden values of the given keys.
bool
stackContains(string $key, mixed $value, bool $strict = false)
Determine if the given value is in the given stack.
bool
hiddenStackContains(string $key, mixed $value, bool $strict = false)
Determine if the given value is in the given hidden stack.
protected bool
isHiddenStackable(string $key)
Determine if a given key can be used as a hidden stack.
mixed
scope(callable $callback, array $data = [], array $hidden = [])
Run the callback function with the given context values and restore the original context state when complete.
$this
dehydrating(callable $callback)
Execute the given callback when context is about to be dehydrated.
Repository
handleUnserializeExceptionsUsing(callable|null $callback)
Handle unserialize exceptions using the given callback.