We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 635688f commit 069ca85Copy full SHA for 069ca85
1 file changed
packages/orm/src/Cast/JsonCast.php
@@ -97,8 +97,8 @@ public function serialize(mixed $data): mixed
97
return array_values(TypeCast::toArray($data));
98
}
99
100
- if ($this->options & static::EMPTY_ARRAY_AS_OBJECT) {
101
- return TypeCast::toObject($data, $this->deep);
+ if ($data === [] && $this->options & static::EMPTY_ARRAY_AS_OBJECT) {
+ return (object) $data;
102
103
104
return $data;
0 commit comments