'Change the display of date format in error/valiadtion messages in laravel 8.x +

validator with rule date_format:d

gives me the unreadable

The :attribute does not match the format :format.

e.g.

birth day does not match the format d

now a user is not a developer, they won't understand what is d

I saw you can use your own replacer somehow here

https://github.com/laravel/framework/blob/b9203fca96960ef9cd8860cb4ec99d1279353a8d/src/Illuminate/Validation/Concerns/ReplacesAttributes.php#L68

the question is, how to properly overwrite that function? how to get your own proper validator?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source