From f5625f421d3b3645e4937da660e597e5785026aa Mon Sep 17 00:00:00 2001 From: Jade Geels Date: Mon, 18 May 2026 11:11:56 +0200 Subject: [PATCH] Return null on no values instead of empty array --- src/Models/AbstractAttribute.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Models/AbstractAttribute.php b/src/Models/AbstractAttribute.php index 9943e3b6d..448e1ca86 100644 --- a/src/Models/AbstractAttribute.php +++ b/src/Models/AbstractAttribute.php @@ -70,7 +70,8 @@ protected function value(): Attribute return e(htmlspecialchars_decode($val), false); }, Arr::wrap($value)); - if (count($value) === 1) { + // NOTE: doing it this way properly returns null when there are no values + if (count($value) <= 1) { return Arr::first($value); }