I have array of id and i want to validate each id with database table using laravel validator so how can i validate multiple id
My code like this
$idArray = [10,15,16]; // I have tree routine_schedule table id
$validatior = Validator::make(array("id"=>$idArray), ["id"=>"required|exists:routine_schedule,id"]);
if ($validatior->passes()){
exit('valid');
}else{
exit('invalid');
}
I wan to validate each and every id is exist in routine_schedule table? so how can i validate this array id's