S
S
shasoft2018-12-20 16:23:47
Internationalization and localization
shasoft, 2018-12-20 16:23:47

How to indicate localized field names in Laravel validation errors?

When displaying messages, the technical names of the fields are indicated.
yjrOyQF.png
Is it possible to somehow set up the normal field names there? So that the user generally understands what field we are talking about?
Those. so that instead of title there is a title

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jazzus, 2018-12-20
@shasoft

Of course, I'm just learning myself) but it seems like in the resources/lang/language code/validation.php file at the very end there are attributes
And there you can do

'attributes' => [
      'title' => 'Заголовок',
    ],

T
Tesla, 2018-12-20
@Tesla

https://laravel.com/docs/5.7/validation#custom-err...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question