N
N
nick1m2022-02-28 19:42:26
Validation
nick1m, 2022-02-28 19:42:26

Laravel validator :attribute replace name with alt?

Laravel's validator outputs a name attribute, which is inconvenient for the user

Let's say there is a text field for the subject of the message
When the validator throws an error, the user gets a message like: The subject field must not be empty.

Let's say a "human" name can be entered in the alt attribute, but how to display alt instead of name?

Or are there other ways to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sanes, 2022-02-28
@nick1m

/lang/ru/validation.php

return [
    'attributes' => [
        'email' => 'Email',
        'name' => 'Имя',
        'password' => 'Пароль',
    ]
];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question