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
We assume you've already for the Inertia adapter for Laravel installed.
16
23
17
24
## What Problem Does This Package Solve?
@@ -233,6 +240,22 @@ class DemoController extends Controller
233
240
}
234
241
```
235
242
243
+
## Attribute Name Formatting
244
+
The attribute name format can be configured in the configuration file by setting the `attribute_name_formatter`.
245
+
The package ships with three formatters under the namespace `\Webfox\InertiaDataProviders\AttributeNameFormatters` but you are free to create your own.
246
+
247
+
### AsWritten
248
+
This is the default formatter. The output attribute name will be the same as the input name.
249
+
E.g. a property named `$someData` and a method named `more_data()` will be available in the page as `someData` and `more_data`.
250
+
251
+
### SnakeCase
252
+
This formatter will convert the attribute name to snake_case.
253
+
E.g. a property named `$someData` and a method named `more_data()` will be available in the page as `some_data` and `more_data`.
254
+
255
+
### CamelCase
256
+
This formatter will convert the attribute name to camelCase.
257
+
E.g. a property named `$someData` and a method named `more_data()` will be available in the page as `someData` and `moreData`.
258
+
236
259
## Changelog
237
260
238
261
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
0 commit comments