-
I want to have my model like this: Model object:
Database table:
HTTP request/response:
Is here any config option to make models serialized as camelCase globally? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You'll want to define your own naming strategy and apply it to your Models or the AdonisJS BaseModel I also have a lesson on this on Adocasts, though we create our own |
Beta Was this translation helpful? Give feedback.
You'll want to define your own naming strategy and apply it to your Models or the AdonisJS BaseModel
https://docs.adonisjs.com/reference/orm/naming-strategy#document
https://docs.adonisjs.com/reference/orm/base-model#static-namingstrategy
I also have a lesson on this on Adocasts, though we create our own
BaseModel
extending Adonis' in my lesson, either way works though.https://www.youtube.com/watch?v=OAzvVHnsU8M