Skip to content

Commit 13ae12f

Browse files
Merge branch '6.x' into 7.x
2 parents cadbd47 + c3e7c3d commit 13ae12f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Eloquent/Concerns/HasRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null
256256
// If the type value is null it is probably safe to assume we're eager loading
257257
// the relationship. In this case we'll just pass in a dummy query where we
258258
// need to remove any eager loads that may already be defined on a model.
259-
return empty($class = $this->{$type})
259+
return is_null($class = $this->{$type}) || $class === ''
260260
? $this->morphEagerTo($name, $type, $id, $ownerKey)
261261
: $this->morphInstanceTo($class, $name, $type, $id, $ownerKey);
262262
}

0 commit comments

Comments
 (0)