Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amoktar's avatar

Laravel api, JsonResource, apisauce [data.data] response

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 ?

0 likes
4 replies
Tippin's avatar

@amoktar No problem. Did that solution work out for you? If so, please select the vest answer :)

Please or to participate in this conversation.