jeudi 26 mai 2016

Laravel 5.2 - validate value in array

I am trying to ensure a field is valid if the value appears in a predefined array, but it's not working for me.

The validation rule I am using is:

'title' => [
     'required',
     'in' => ['Mr', 'Mrs', 'Miss', 'Ms'],
],

But it seems to pass validation if I enter an invalid value, such as "Dr".

Anyone know the correct way to do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire