You can just loop over a returned eloquent result. You shouldn't need to transform anything.
Aug 28, 2023
8
Level 4
API Resource for non APIs
I'm aware when building an API, you can use API Resources to modify data from the database, to present it to thE front end.
But, with a standard/Inertia application, I return data from the model, but I find that I would like a middle layer to transform the data before it's passed back to JS and rendered.
What can I utilize to do this?
Please or to participate in this conversation.