* Fixed #892

* #892 test added
This commit is contained in:
Kirill Uksusov
2020-03-03 10:48:00 +01:00
committed by GitHub
parent edd69c5e05
commit e743f44011
3 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -505,7 +505,7 @@ class ModelsCommand extends Command
'morphedByMany' => '\Illuminate\Database\Eloquent\Relations\MorphToMany'
) as $relation => $impl) {
$search = '$this->' . $relation . '(';
if (stripos($code, $search) || $impl === (string)$type) {
if (stripos($code, $search) || ltrim($impl, '\\') === ltrim((string)$type, '\\')) {
//Resolve the relation's model to a Relation object.
$methodReflection = new \ReflectionMethod($model, $method);
if ($methodReflection->getNumberOfParameters()) {