diff --git a/src/Casts/MetaValue.php b/src/Casts/MetaValue.php index 2f276c29d..55b7fe255 100644 --- a/src/Casts/MetaValue.php +++ b/src/Casts/MetaValue.php @@ -15,7 +15,7 @@ class MetaValue implements CastsAttributes */ public function get(Model $model, string $key, mixed $value, array $attributes): mixed { - return json_decode($value, true) ?? $value; + return is_null($value) ? $value : (json_decode($value, true) ?? $value); } /**