diff --git a/src/Eloquent/Relations/Traits/HasExistenceQueries.php b/src/Eloquent/Relations/Traits/HasExistenceQueries.php index 1f31670..7f16288 100644 --- a/src/Eloquent/Relations/Traits/HasExistenceQueries.php +++ b/src/Eloquent/Relations/Traits/HasExistenceQueries.php @@ -51,13 +51,8 @@ public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $query->getModel()->setTable($hash); - $from = is_string($parentQuery->getQuery()->from) - ? $parentQuery->getQuery()->from - // @codeCoverageIgnoreStart - : (string) $parentQuery->getQuery()->from->getValue( - $parentQuery->getQuery()->getGrammar() - ); - // @codeCoverageIgnoreEnd + /** @var string $from */ + $from = $query->getQuery()->from; $query->select($columns)->whereColumn( "$from.$this->localKey", diff --git a/src/HasManyDeep.php b/src/HasManyDeep.php index b691755..103202a 100644 --- a/src/HasManyDeep.php +++ b/src/HasManyDeep.php @@ -119,13 +119,8 @@ protected function performJoin(?Builder $query = null) $foreignKeys = array_reverse($this->foreignKeys); $localKeys = array_reverse($this->localKeys); - $from = is_string($query->getQuery()->from) - ? $query->getQuery()->from - // @codeCoverageIgnoreStart - : (string) $query->getQuery()->from->getValue( - $query->getQuery()->getGrammar() - ); - // @codeCoverageIgnoreEnd + /** @var string $from */ + $from = $query->getQuery()->from; $segments = explode(' as ', $from);