Skip to content

Commit 069ca85

Browse files
committed
Fix JsonObject
1 parent 635688f commit 069ca85

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/orm/src/Cast/JsonCast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public function serialize(mixed $data): mixed
9797
return array_values(TypeCast::toArray($data));
9898
}
9999

100-
if ($this->options & static::EMPTY_ARRAY_AS_OBJECT) {
101-
return TypeCast::toObject($data, $this->deep);
100+
if ($data === [] && $this->options & static::EMPTY_ARRAY_AS_OBJECT) {
101+
return (object) $data;
102102
}
103103

104104
return $data;

0 commit comments

Comments
 (0)