[Issue] Returned Data object is not wrapped by default into 'data' as Laravel Resources do #177
didac-adria
started this conversation in
General
Replies: 1 comment
-
This discussion can be deleted. We have discovered that we can use the data.php config file for this. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey community!
We have found that, when returning a single Data object of this package from a controller, the default behaviour is to NOT wrap data into the 'data' array. This behaviour differs from the Laravel default behaviour when returning a Resource. We think it could be interesting to match it with the Laravel Resources.
For instance, we have multiple endpoints, and in some we are returning Laravel resources and now we have some returning Data objects of this package. It's interesting to have the same behaviour or at least, have a way to set the default behaviour for all endpoints so you don't have to make:
->wrap('data')
in all places.Beta Was this translation helpful? Give feedback.
All reactions