diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 095fab64e..395cf9d79 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -826,7 +826,7 @@ public function getPropertiesFromMethods($model) $matches = []; $returnType = $this->getReturnTypeFromDocBlock($reflection); if ($returnType !== null) { - preg_match('/MorphTo<(.+?)(?:,|>)/i', $returnType, $matches); + preg_match('/MorphTo<(?:contravariant\s+)?(.+?)(?:,|>)/i', $returnType, $matches); } // Model isn't specified because relation is polymorphic