mardi 17 septembre 2019

How to validate an ID which should be in given array - Laravel

I have an array which is

array (
  0 => 1,
  1 => 7,
  2 => 11,
  3 => 8,
  4 => 5,
) 

Now I want to validate a field status which should be in the given list.

$validation = Validator::make($req->all(),[
    'status.*.id' => 'required'
]);

How can I validate the status? Can anyone suggest any solution? Thank You.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire