diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 587fa29..0b92f85 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -480,7 +480,7 @@ class ModelsCommand extends Command 'morphedByMany' => '\Illuminate\Database\Eloquent\Relations\MorphToMany' ) as $relation => $impl) { $search = '$this->' . $relation . '('; - if (stripos($code, $search) || stripos($impl, $type) !== false) { + if (stripos($code, $search) || stripos($impl, (string)$type) !== false) { //Resolve the relation's model to a Relation object. $methodReflection = new \ReflectionMethod($model, $method); if ($methodReflection->getNumberOfParameters()) {