Skip to content

Commit 6b87add

Browse files
authored
use Second Local Key name from hasOneThrough Relation instead getForeignKey from Pivot Table
1 parent 0f77680 commit 6b87add

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EloquentDataTable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ protected function joinEagerLoadedColumn($relation, $relationColumn)
195195

196196
$related = $model->getRelated();
197197
$table = $related->getTable();
198-
$tablePK = $related->getForeignKey();
198+
$tablePK = $model->getSecondLocalKeyName();
199199
$foreign = $pivot . '.' . $tablePK;
200200
$other = $related->getQualifiedKeyName();
201201

0 commit comments

Comments
 (0)