From 3680d1ad84c84dcf6198482cbc24b7e8514d4f90 Mon Sep 17 00:00:00 2001 From: Keith Brink Date: Thu, 12 Dec 2024 15:52:55 +0300 Subject: [PATCH] fix validation error on mixed types --- src/Data/Base/Validators/RuleValidator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Data/Base/Validators/RuleValidator.php b/src/Data/Base/Validators/RuleValidator.php index 7199381c..27b04690 100644 --- a/src/Data/Base/Validators/RuleValidator.php +++ b/src/Data/Base/Validators/RuleValidator.php @@ -4,6 +4,7 @@ use Attribute; use Illuminate\Filesystem\Filesystem; +use Illuminate\Support\Str; use Illuminate\Translation\FileLoader; use Illuminate\Translation\Translator; use Illuminate\Validation\Factory; @@ -35,7 +36,7 @@ public function validate(mixed $value): void ]); if ($validator->fails()) { - throw new DataValidationException('Invalid value: ' . $value . ', errors: ' . implode(',', $validator->errors()->get('value'))); + throw new DataValidationException('Invalid value: ' . Str::limit(var_export($value, true), 50) . ', errors: ' . implode(',', $validator->errors()->get('value'))); } } }