Is your feature request related to a problem? Please describe.
Currently the REST/AJAX APIs only return raw data. REST responses are converted to JSON automatically.
Describe the solution you'd like
A consistent Response object to be able to return raw arrays and have them automatically converted into JSON etc.
Describe alternatives you've considered
Writing json_encode within the controllers
Additional context
Laravel returns a response object that automatically converts to JSON, HTML etc as required. Also a response helper method with the ability to add additional headers.
Is your feature request related to a problem? Please describe. Currently the REST/AJAX APIs only return raw data. REST responses are converted to JSON automatically.
Describe the solution you'd like A consistent
Response
object to be able to return raw arrays and have them automatically converted into JSON etc.Describe alternatives you've considered Writing
json_encode
within the controllersAdditional context Laravel returns a response object that automatically converts to JSON, HTML etc as required. Also a
response
helper method with the ability to add additional headers.