Closed joscdk closed 7 years ago
@rugaard can you have a look at this
From my investigation I conclude that this issue is cause by the usage of /admin as an API endpoint. API routes are registered with the API route helpers (like api_get()).
Since the routes in question are being registered through the Route facade, all the Dingo setup is not being made, resulting in custom adapters and transformers not being used.
@Casperhr @rugaard can you please verify?
@Skyback You're pretty much accurate. It was never intended to use transformers for a "backend endpoint". There you should simply use response()->json()
to return JSON.
When you're using the api_
methods the routes are - as you say - registered with Dingo, which is setup to return the structure with the data
as root.
@rugaard Thanks for the confirmation. Will close this issue since it's due to bad implementation.
route
controller
response
The JSON is in a parent array, and Transformer isn't used.