diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 037ddfb35ff6..134d06a42d59 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -798,7 +798,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 (empty($class = $this->$type)) { return new MorphTo( $this->newQuery(), $this, $id, null, $type, $name );