From f0b6450647d11b6139caa58d808d4a90cfbb4be1 Mon Sep 17 00:00:00 2001 From: Rajkumar Dusad <32831684+rajkumardusad@users.noreply.github.com> Date: Sun, 10 Jan 2021 20:55:20 +0530 Subject: [PATCH] Update Validator.php --- src/Validator.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Validator.php b/src/Validator.php index a9351f8..f9285d7 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -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 {