dimanche 19 juin 2016

Laravel before/after validation message

In Laravel you can make a custom messages for validators. But I found that the prepared messages are little bit wrong. With before and after validation rules, the parameter is converted with strtotime like that said in the documentation.

So if I set rule 'expires' => 'before:+1 year' the rule is working and correct. But if the user inputs a wrong value, Laravel prints the message like that:

The expires must be a date before +1 year

This message is very unclear for the average client. I was expected that the message will be converted with the strtotime also.

There is a clean way to print more clear error message?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire