A
A
Alexey Gus2021-06-15 17:31:36
Twig
Alexey Gus, 2021-06-15 17:31:36

How to output validation errors to a view in laravel 5.5 + twig?

The essence of the question is that, about registration, it is necessary to make the output of errors under the inputs themselves. At the moment, all errors come out as flash messages at the bottom.
I've tried everything, I've run out of ideas. Well, who knows what and how to do it? I will be very grateful!))

that's how the validation is implemented now.

$rules = [
                 *правила*
            ];
            $messages = [
             *сообщения*
            ];
            $validation = Validator::make($data, $rules, $messages );
            if ($validation->fails()) {
                throw new ValidationException($validation);
            }


in symphony, the truth of the 5th version was done in the view just {{error}} (like so)) it was a long time ago)) and everything worked) And here and there it doesn’t work ... I
tried {{errors.any()}} there always false even when there are errors ... maybe they need to be passed somehow?) ideally without page reload))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question