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 30
static void
macro(string $name, callable|object $macro)
Register a custom macro.
Macros persist in a static property for the worker lifetime and apply to every subsequent call on the macroable class.
in
Macroable at line 44
static void
mixin(object $mixin, bool $replace = true)
Mix another object into the class.
Delegates to macro() for each method; registered macros persist in a static property for the worker lifetime.
in
Macroable at line 61
static bool
hasMacro(string $name)
Check if macro is registered.
in
Macroable at line 72
static void
flushMacros()
Flush the existing macros.
Clears worker-wide macros; concurrent coroutines may resolve different methods depending on timing.
in
Macroable at line 83
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
at line 116
mixed
__call(string $method, array $parameters)
Dynamically pass method calls to the underlying resource.
at line 22
mixed
getRouteKey()
Get the value of the resource's route key.
at line 30
string
getRouteKeyName()
Get the route key for the resource.
at line 40
never
resolveRouteBinding(mixed $value, string|null $field = null)
Retrieve the model for a bound value.
at line 51
Model|null
resolveChildRouteBinding(string $childType, mixed $value, string|null $field = null)
Retrieve the model for a bound value.
at line 60
bool
offsetExists(mixed $offset)
Determine if the given attribute exists.
at line 68
mixed
offsetGet(mixed $offset)
Get the value for a given offset.
at line 76
void
offsetSet(mixed $offset, mixed $value)
Set the value for a given offset.
at line 84
void
offsetUnset(mixed $offset)
Unset the value for a given offset.
at line 92
bool
__isset(string $key)
Determine if an attribute exists on the resource.
at line 100
void
__unset(string $key)
Unset an attribute on the resource.
at line 108
mixed
__get(string $key)
Dynamically get properties from the underlying resource.