ResourceResponse
class ResourceResponse implements Responsable (View source)
Properties
mixed | $resource | The underlying resource. |
Methods
__construct(mixed $resource)
Create a new resource response.
Response
array
wrap(Collection|array $data, array $with = [], array $additional = [])
Wrap the given data if necessary.
bool
haveDefaultWrapperAndDataIsUnwrapped(array $data)
Determine if we have a default wrapper and the given data is unwrapped.
bool
haveAdditionalInformationAndDataIsUnwrapped(array $data, array $with, array $additional)
Determine if "with" data has been added and our data is unwrapped.
string
wrapper()
Get the default data wrapper for the resource.
int
calculateStatus()
Calculate the appropriate status code for the response.
Details
protected array
wrap(Collection|array $data, array $with = [], array $additional = [])
Wrap the given data if necessary.
protected bool
haveDefaultWrapperAndDataIsUnwrapped(array $data)
Determine if we have a default wrapper and the given data is unwrapped.