Closed flyingluscas closed 7 years ago
The webservice responses API was improved, making more readable and more simple to use transformers.
Now to return a response from a controller you must use the new response property from the ApiController, see some examples below.
$this->response->json([ 'some kind' => 'of data', ]); $this->response->collection($items, new MyTransformerClass); $this->response->item($item, new MyTransformerClass); $this->response->withTooManyRequests(); $this->response->withUnauthorized(); $this->response->withInternalServerError(); $this->response->withNotFound(); $this->response->withNoContent(); $this->response->withError('Some error message');
The webservice responses API was improved, making more readable and more simple to use transformers.
Now to return a response from a controller you must use the new response property from the ApiController, see some examples below.