diff --git a/src/Traits/EloquentJoinTrait.php b/src/Traits/EloquentJoinTrait.php index 8875730..06dffbd 100644 --- a/src/Traits/EloquentJoinTrait.php +++ b/src/Traits/EloquentJoinTrait.php @@ -113,7 +113,7 @@ private function performJoin($builder, $relations) $builder->leftJoin($joinQuery, function ($join) use ($relatedTableAlias, $keyRelated, $currentTable, $relatedPrimaryKey, $relatedModel) { $join->on($relatedTableAlias . '.' . $relatedPrimaryKey, '=', $currentTable . '.' . $keyRelated); - $this->leftJoinQuery($join, $relatedModel, $relatedTableAlias, $keyRelated, $currentTable, $relatedPrimaryKey); + $this->leftJoinQuery($join, $relatedModel, $relatedTableAlias); }); } elseif ($relatedRelation instanceof HasOneJoin) { $keyRelated = $relatedRelation->getForeignKey(); @@ -122,7 +122,7 @@ private function performJoin($builder, $relations) $builder->leftJoin($joinQuery, function ($join) use ($relatedTableAlias, $keyRelated, $currentTable, $relatedPrimaryKey, $relatedModel) { $join->on($relatedTableAlias . '.' . $keyRelated, '=', $currentTable . '.' . $relatedPrimaryKey); - $this->leftJoinQuery($join, $relatedModel, $relatedTableAlias, $keyRelated, $currentTable, $relatedPrimaryKey); + $this->leftJoinQuery($join, $relatedModel, $relatedTableAlias); }); } else { throw new EloquentJoinException('Only allowed relations for whereJoin, orWhereJoin and orderByJoin are BelongsToJoin, HasOneJoin');