This commit is contained in:
2021-10-19 18:23:18 +08:00
parent fa7ac67206
commit bbc6227220
+2 -1
View File
@@ -148,11 +148,12 @@ class Collection extends AbstractCollection
public function toArray(): array
{
$array = [];
/** @var Model $value */
foreach ($this as $value) {
if (!is_object($value)) {
continue;
}
$array[] = $value->toArray();
$array[] = $value->setWith($this->query->with)->toArray();
}
$this->_item = [];
return $array;