You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to define a model which uses camelCase for the attributes, but underscore/snake case when converted to json, or maybe even a field name that will be used for JSON only?
Not possible. The attribute names are used for getting values, toJSON uses methods for getting values.
Overwrite toJSON or don't use camel cased attribute names.
Is it possible to define a model which uses camelCase for the attributes, but underscore/snake case when converted to json, or maybe even a field name that will be used for JSON only?
Currently;
Turns into when calling response.json(user)
And I want it to be
Any ideas?
The text was updated successfully, but these errors were encountered: