From 9d537bdd58ced4345a3a3a7aedd147aecfbbcbbd Mon Sep 17 00:00:00 2001 From: Joren Dandois Date: Wed, 6 Jan 2021 11:06:05 +0100 Subject: [PATCH] Fix #35795 Add an extra is_null check for php 8 --- src/Illuminate/Validation/Concerns/ValidatesAttributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 6bd27d55b07e..c0c5411c1391 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1146,7 +1146,7 @@ public function validateJson($attribute, $value) return false; } - if (! is_scalar($value) && ! method_exists($value, '__toString')) { + if (! is_scalar($value) && ! is_null($value) && ! method_exists($value, '__toString')) { return false; }