From fd25d4816fb9e4c86a01da121e896f2107299c7b Mon Sep 17 00:00:00 2001 From: Arjay Angeles Date: Mon, 22 May 2017 12:21:34 +0800 Subject: [PATCH] Fix column name added when relation is belongsToMany. Fix #1094 --- src/Engines/QueryBuilderEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Engines/QueryBuilderEngine.php b/src/Engines/QueryBuilderEngine.php index 11846c61..c2d4d57c 100644 --- a/src/Engines/QueryBuilderEngine.php +++ b/src/Engines/QueryBuilderEngine.php @@ -561,7 +561,7 @@ protected function joinEagerLoadedColumn($relation, $relationColumn) $foreign = $pivot . '.' . $tablePK; $other = $related->getQualifiedKeyName(); - $lastQuery->addSelect($table . '.' . $eachRelation); + $lastQuery->addSelect($table . '.' . $relationColumn); $this->performJoin($table, $foreign, $other); break;