Closed JBou closed 2 years ago
Should I include a short documentation at the end of this paragraph (just a sentence with a link to Customizing The Validation Attributes) or is it okay as it is?
Hi Gabriel,
thank you for this contribution. I don't think that additional documentation is required, since this PR leverages the standard laravel features. Indeed, I guess it was your starting point, you tried to override the attributes()
method of the request and nothing happened, right?
Exactly, that was my starting point. Thanks for merging!
Description
This commit allows Customizing The Validation Attributes and supports translated attribute names
Motivation and context
Before this PR it was not possible to change the displayed name of the field when using the validator to validate an input field. The error message always showed the name of the input field, for example:
The tax_number contains bad omocodia characters
Now you can change the displayed name of the attribute and you can even translate it.The codice fiscale contains bad omocodia characters
How has this been tested?
using this code:
i tried it using the validator, it successfully changed the name of the attribute as written above.
Screenshots (if appropriate)
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist: