DelegatesToResource
trait DelegatesToResource
Traits
Properties
| static protected array | $macros | The registered string macros. |
from Macroable |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
Throw a bad method call exception for the given method.
Mix another object into the class.
Dynamically handle calls to the class.
Dynamically pass method calls to the underlying resource.
Get the value of the resource's route key.
Get the route key for the resource.
Retrieve the model for a bound value.
Retrieve the model for a bound value.
Determine if the given attribute exists.
Get the value for a given offset.
Set the value for a given offset.
Unset the value for a given offset.
Determine if an attribute exists on the resource.
Unset an attribute on the resource.
Dynamically get properties from the underlying resource.
Details
in
ForwardsCalls at line 22
protected mixed
forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
in
ForwardsCalls at line 52
protected mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object, returning $this if the forwarded call returned itself.
in
ForwardsCalls at line 66
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
in
Macroable at line 28
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Boot-only. Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 41
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Boot-only. Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 57
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 68
static void
flushMacros()
Flush the existing macros.
Boot or tests only. Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 78
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 113
mixed
__call(string $method, array $parameters)
Dynamically pass method calls to the underlying resource.
at line 21
mixed
getRouteKey()
Get the value of the resource's route key.
at line 29
string
getRouteKeyName()
Get the route key for the resource.
at line 39
never
resolveRouteBinding(mixed $value, string|null $field = null)
Retrieve the model for a bound value.
at line 49
Model|null
resolveChildRouteBinding(string $childType, mixed $value, string|null $field = null)
Retrieve the model for a bound value.
at line 57
bool
offsetExists(mixed $offset)
Determine if the given attribute exists.
at line 65
mixed
offsetGet(mixed $offset)
Get the value for a given offset.
at line 73
void
offsetSet(mixed $offset, mixed $value)
Set the value for a given offset.
at line 81
void
offsetUnset(mixed $offset)
Unset the value for a given offset.
at line 89
bool
__isset(string $key)
Determine if an attribute exists on the resource.
at line 97
void
__unset(string $key)
Unset an attribute on the resource.
at line 105
mixed
__get(string $key)
Dynamically get properties from the underlying resource.