mercredi 31 août 2016

Laravel 5 - How to add custom msgs to Validation?

Im trying to figure out how to quickly add error messages per field in Laravel 5. Here is what I got:

$validator = Validator::make($this->req->all(), [
'email_add' => 'required|email|max:100',
'pass' => 'required|max:20',
]);

So how do I put a message directly here for each field validated above?

like "You forgot Email Address" and "Password is Required"?

(without writing a mars rover program for 1 simple task. Like the usualy laravel 5 stuff of artisan make new something useless, add 2 name spaces, 3 middlewares, 5 classes, 7 functions and then finally override error messages!!)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire