On this page
DelegatesToResource
trait DelegatesToResource (View source)
Traits
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
Methods
mixed | forwardCallTo(mixed $object, string $method, array $parameters) Forward a method call to the given object. |
from ForwardsCalls |
mixed | forwardDecoratedCallTo(mixed $object, string $method, array $parameters) Forward a method call to the given object, returning $this if the forwarded call returned itself. |
from ForwardsCalls |
static void | throwBadMethodCallException(string $method) Throw a bad method call exception for the given method. |
from ForwardsCalls |
static void | macro(string $name, object|callable $macro) Register a custom macro. |
from Macroable |
static void | mixin(object $mixin, bool $replace = true) Mix another object into the class. |
from Macroable |
static bool | hasMacro(string $name) Checks if macro is registered. |
from Macroable |
static void | flushMacros() Flush the existing macros. |
from Macroable |
static mixed | __callStatic(string $method, array $parameters) Dynamically handle calls to the class. |
from Macroable |
mixed | __call(string $method, array $parameters) Dynamically pass method calls to the underlying resource. |
|
mixed | getRouteKey() Get the value of the resource's route key. |
|
string | getRouteKeyName() Get the route key for the resource. |
|
void | resolveRouteBinding(mixed $value, string|null $field = null) Retrieve the model for a bound value. |
|
void | resolveChildRouteBinding(string $childType, mixed $value, string|null $field = null) Retrieve the model for a bound value. |
|
bool | offsetExists(mixed $offset) Determine if the given attribute exists. |
|
mixed | offsetGet(mixed $offset) Get the value for a given offset. |
|
void | offsetSet(mixed $offset, mixed $value) Set the value for a given offset. |
|
void | offsetUnset(mixed $offset) Unset the value for a given offset. |
|
bool | __isset(string $key) Determine if an attribute exists on the resource. |
|
void | __unset(string $key) Unset an attribute on the resource. |
|
mixed | __get(string $key) Dynamically get properties from the underlying resource. |
Details
protected mixed forwardCallTo(mixed $object, string $method, array $parameters)
Forward a method call to the given object.
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.
static protected void throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
static void macro(string $name, object|callable $macro)
Register a custom macro.
static void mixin(object $mixin, bool $replace = true)
Mix another object into the class.
static bool hasMacro(string $name)
Checks if macro is registered.
static void flushMacros()
Flush the existing macros.
static mixed __callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed __call(string $method, array $parameters)
Dynamically pass method calls to the underlying resource.
mixed getRouteKey()
Get the value of the resource's route key.
string getRouteKeyName()
Get the route key for the resource.
void resolveRouteBinding(mixed $value, string|null $field = null)
Retrieve the model for a bound value.
void resolveChildRouteBinding(string $childType, mixed $value, string|null $field = null)
Retrieve the model for a bound value.
bool offsetExists(mixed $offset)
Determine if the given attribute exists.
mixed offsetGet(mixed $offset)
Get the value for a given offset.
void offsetSet(mixed $offset, mixed $value)
Set the value for a given offset.
void offsetUnset(mixed $offset)
Unset the value for a given offset.
bool __isset(string $key)
Determine if an attribute exists on the resource.
void __unset(string $key)
Unset an attribute on the resource.
mixed __get(string $key)
Dynamically get properties from the underlying resource.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/10.x/Illuminate/Http/Resources/DelegatesToResource.html