ApiResource
class ApiResource implements Stringable, ArrayAccess, JsonSerializable, Arrayable, Jsonable mixin ApiResponse
Traits
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.
No description
Determine if an attribute exists on the resource.
Unset an attribute on the resource.
Dynamically get properties from the underlying resource.
Dynamically pass method calls to the underlying resource.
No description
No description
Create a new resource instance.
Resolve the resource to an array.
Transform the resource into an array.
Convert the resource to its JSON representation.
Prepare the resource for JSON serialization.
Implementation of ArrayAccess::offsetExists.
Implementation of ArrayAccess::offsetGet.
Implementation of ArrayAccess::offsetSet.
Implementation of ArrayAccess::offsetUnset.
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.
at line 25
__construct(ApiResponse $response, ApiRequest $request)
Create a new resource instance.
at line 31
string
__toString()
No description
at line 39
bool
__isset(string $key)
Determine if an attribute exists on the resource.
at line 47
void
__unset(string $key)
Unset an attribute on the resource.
at line 55
mixed
__get(string $key)
Dynamically get properties from the underlying resource.
at line 63
mixed
__call(string $method, array $parameters)
Dynamically pass method calls to the underlying resource.
at line 74
ApiResponse
getResponse()
No description
at line 79
ApiRequest
getRequest()
No description
at line 87
static ApiResource
make(mixed ...$parameters)
Create a new resource instance.
at line 95
array
resolve()
Resolve the resource to an array.
at line 103
array
toArray()
Transform the resource into an array.
at line 111
string
toJson(int $options = 0)
Convert the resource to its JSON representation.
at line 119
mixed
jsonSerialize()
Prepare the resource for JSON serialization.
at line 127
bool
offsetExists(mixed $offset)
Implementation of ArrayAccess::offsetExists.
at line 135
mixed
offsetGet(mixed $offset)
Implementation of ArrayAccess::offsetGet.
at line 143
void
offsetSet(mixed $offset, mixed $value)
Implementation of ArrayAccess::offsetSet.
at line 151
void
offsetUnset(mixed $offset)
Implementation of ArrayAccess::offsetUnset.