whitecube / nova-flexible-content

Flexible Content & Repeater Fields for Laravel Nova
MIT License
788 stars 228 forks source link

Use field name for validation message instead of attribute #410

Open m-lotze opened 1 year ago

m-lotze commented 1 year ago

A nova field would use the name of a field for the validation message:

Field::make('Name', 'attribute')->rules('required')

This would return the message Name is required. The same field used in a flexible layout will return the message attribute is required, except when the validation language file has a translation for the attribute.

I think this package should use the nova standard of replacing the attribute with the name for error messages as a default, so it is not necessary to add every attribute in the validation config.

voidgraphics commented 1 year ago

Sounds good, please submit a pull request. 👍