Skip to content

Commit

Permalink
Update Validator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkumardusad committed Jan 10, 2021
1 parent 9f8224f commit f0b6450
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Validator.php
Expand Up @@ -113,9 +113,14 @@ public function validate($data, $multiple_data=false) : bool {
//Validate multiple data
if($multiple_data === true) {
foreach($data as $single_data) {
if($this->$func($single_data, $data_key, $rules) === false) {
$is_valid = false;
break;
if(is_array($single_data)) {
if($this->$func($single_data, $data_key, $rules) === false) {
$is_valid = false;
break;
}
} else {
$this->errors['error'] = 'Invalid data for validation';
return false;
}
}
} else {
Expand Down

0 comments on commit f0b6450

Please sign in to comment.