Forms
Last updated
Was this helpful?
Last updated
Was this helpful?
If you want to translate a field in multiple locales with a single form you can use the overridden fill()
method which allows you to pass in an array with the locales as first array key and the translated attributes in the sub-array.
To achieve this structure in your form - to prevent manipulating the form data just to save them. You can use the input name array []
.
If you want, you can structure the request inputs in colon notation too. Notice that with this approach the attribute goes first.
Both ways are ready to save the translatable attributes to the model without any other modification.
You can update the default locale attributes by accessing the translatable attributes from the model itself.