Skip to content

Commit 6ba5b4f

Browse files
authored
Update Datatable.php
1 parent 3ca5997 commit 6ba5b4f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Datatable.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ protected function queryJoinBuilder(Builder $query, Relation $relation) {
133133
// This avoids any leftJoin's commited before or after this query call by the end user
134134
$uniqueId = Str::random(16);
135135
if ($relation instanceof HasOne) {
136-
// @todo doesn't work with uniqueId right now
137-
$relatedPrimaryKey = $relation->getQualifiedForeignKeyName();
136+
$relatedPrimaryKey = "{$uniqueId}.{$relation->getForeignKeyName()}";
138137
$parentPrimaryKey = $relation->getQualifiedParentKeyName();
139138
} elseif ($relation instanceof BelongsTo) {
140139
$relatedPrimaryKey = "{$uniqueId}.{$relation->getOwnerKeyName()}";

0 commit comments

Comments
 (0)