diff --git a/laravel/validator.php b/laravel/validator.php index 7b6f1e3e..1c72e184 100644 --- a/laravel/validator.php +++ b/laravel/validator.php @@ -211,7 +211,20 @@ protected function error($attribute, $rule, $parameters) */ protected function validate_required($attribute, $value) { - return ! (is_null($value) or (is_string($value) and trim($value) === '')); + if (is_null($value)) + { + return false; + } + elseif (is_string($value) and trim($value) === '') + { + return false; + } + elseif (is_array($value) and count($value) == 0) + { + return false; + } + + return true; } /**