vendredi 13 avril 2018

Combine validation errors and return one single message

I have two arrays I want to validate in my custom Request:

$rules = [
  'params.words1.*.value' => 'required|string|between:5,50',
  'params.words2.*.value' => 'required|string|between:5,50',
];

This returns an error message per each word. But I want a single general message like "Some of the words are invalid". Is there any Laravel-way to do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire