Skip to content

Commit

Permalink
Merge branch '6.x' into 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 5, 2020
2 parents cadbd47 + c3e7c3d commit 13ae12f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Eloquent/Concerns/HasRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null
// If the type value is null it is probably safe to assume we're eager loading
// the relationship. In this case we'll just pass in a dummy query where we
// need to remove any eager loads that may already be defined on a model.
return empty($class = $this->{$type})
return is_null($class = $this->{$type}) || $class === ''
? $this->morphEagerTo($name, $type, $id, $ownerKey)
: $this->morphInstanceTo($class, $name, $type, $id, $ownerKey);
}
Expand Down

0 comments on commit 13ae12f

Please # to comment.