How to use Laravel API Resources with Inertia? #1302
-
I am using Laravel 9, Jetstream, Inertia, Vue 3. I have created an Api Resource for my Model Project
In Vue, in the props "project" i get a nested array "data" and only the objects I need are already in it.
But this is wrong. I don't need a nested data array. I immediately need models in the prop, how it is transferred to the view without using Inertia. Those it should be like this
I don't want to access props in vue via "projects.data" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Found the answer in the documentation https://laravel.com/docs/9.x/eloquent-resources#data-wrapping |
Beta Was this translation helpful? Give feedback.
Found the answer in the documentation https://laravel.com/docs/9.x/eloquent-resources#data-wrapping
Weird, I haven't had to change the AppServiceProvider for this before..