diff --git a/src/Traits/EloquentJoinTrait.php b/src/Traits/EloquentJoinTrait.php index eccc199..63f9fe9 100644 --- a/src/Traits/EloquentJoinTrait.php +++ b/src/Traits/EloquentJoinTrait.php @@ -100,7 +100,7 @@ private function performJoin($builder, $relations) $relatedRelation = $currentModel->$relation(); $relatedModel = $relatedRelation->getRelated(); - $relatedPrimaryKey = $currentModel->getKeyName(); + $relatedPrimaryKey = $relatedModel->getKeyName(); $relatedTable = $relatedModel->getTable(); $this->validateJoinQuery($relatedModel);