Skip to content

Commit

Permalink
Merge pull request #53 from anonim1133/bugfix/joining-on-alias
Browse files Browse the repository at this point in the history
Fixed bug while joining using aliases
  • Loading branch information
fico7489 authored Feb 8, 2019
2 parents 580987a + 3c7d3e6 commit 487abd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EloquentJoinBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private function performJoin($relations, $leftJoin = null)
}

if (!in_array($relationAccumulatedString, $this->joinedTables)) {
$joinQuery = $relatedTableAlias.($this->useTableAlias ? ' as '.$relatedTableAlias : '');
$joinQuery = $relatedTable.($this->useTableAlias ? ' as '.$relatedTableAlias : '');
if ($relatedRelation instanceof BelongsToJoin) {
$relatedKey = $relatedRelation->getQualifiedForeignKey();
$relatedKey = last(explode('.', $relatedKey));
Expand Down

0 comments on commit 487abd9

Please sign in to comment.