Using Mappers
Changing all property names in a data object to snake_case in the data the object is created from can be done as such:Input and Output Mapping
You can also use theMapName attribute when you want to combine input (see transforming data objects) and output property name mapping:
Global Mapping Strategy
It is possible to set a default name mapping strategy for all data objects in thedata.php config file:
Mapping Nested Properties
You can also map nested properties using dot notation in theMapInputName attribute. This is useful when you want to extract a nested value from an array and assign it to a property in your data object:
The package has a set of default mappers available, you can find them here.