I want to make an API first application in Laravel. I don\'t know what is the best approach to do this, I will explain what I am trying to do, but please feel free to give a
I have a response to the problem you are having with the Response. You can get the headers, status code and data from the Response.
// your data
$response->getData();
// the status code of the Response
$response->getStatusCode();
// array of headers
$response->headers->all();
// array of headers with preserved case
$response->headers->allPreserveCase();
$response->headers is a Symfony\Component\HttpFoundation\ResponseHeaderBag which inherits from Symfony\Component\HttpFoundation\HeaderBag