You can disable the wrapping entirely, or per resource:
https://laravel.com/docs/8.x/eloquent-resources#data-wrapping
JsonResource::withoutWrapping();
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello Experts,
I'm woring on a react project, with apisauce to make api requests to laravel controller, and returning reponse in a resource.
the problem comes when laravel resource wrap response with 'data' key,
also apisauce response has an object response.data that I should n't mess with it
so in my react js code response.data is response.data.data
any suggestions ?
Please or to participate in this conversation.