Fixed bug in model command where loose string comparison would override properties for model relations (#873)

This commit is contained in:
Markus Podar
2020-01-12 18:23:52 +01:00
committed by Barry vd. Heuvel
parent 6af1f32d96
commit e020e265a4
2 changed files with 2 additions and 2 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) || stripos($impl, (string)$type) !== false) {
if (stripos($code, $search) || $impl === (string)$type) {
//Resolve the relation's model to a Relation object.
$methodReflection = new \ReflectionMethod($model, $method);
if ($methodReflection->getNumberOfParameters()) {