Skip to content

Commit

Permalink
Fix Issue laravel#11169
Browse files Browse the repository at this point in the history
  • Loading branch information
Aden Fraser committed Apr 28, 2016
1 parent 6e895a1 commit 45d1f0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ public function morphTo($name = null, $type = null, $id = null)
// If the type value is null it is probably safe to assume we're eager loading
// the relationship. When that is the case we will pass in a dummy query as
// there are multiple types in the morph and we can't use single queries.
if (is_null($class = $this->$type)) {
if (is_null($class = $this->$type) || $class === '') {
return new MorphTo(
$this->newQuery(), $this, $id, null, $type, $name
);
Expand Down

0 comments on commit 45d1f0c

Please sign in to comment.