diff --git a/src/ModelGenerator.php b/src/ModelGenerator.php index 5be0a0d..918437d 100644 --- a/src/ModelGenerator.php +++ b/src/ModelGenerator.php @@ -311,7 +311,7 @@ protected function getPropertiesFromMethods() } if ($return instanceof HasMany || $return instanceof HasManyThrough || $return instanceof BelongsToMany) { - $this->addProperty($name, get_class($return->getModel()) . "[]", true, null); + $this->addProperty($name, get_class($return->getModel()) . "[]|\\think\\Collection", true, null); } if ($return instanceof MorphTo || $return instanceof MorphMany) {