I am using Laravel 5.5 in a project.
When I use the
$request->validate([....]); directly in the controller to validate an incoming request, everything works fine, and if there is an error, the correct error message will be shown under the field. For example "This field is required".
However, if I use form-request to separate my validation process from the controller, I get this text instead "validation.required". I am aware that I can use the
messages() method in my form-request to write custom messages. But if I don't define the
messages() method, why doesn't Laravel just display similar message like it would in the controller?
It is possible that I am doing something wrong here.
How can I display the default error messages with form-request
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.