Skip to content

Commit 4106405

Browse files
committed
Use shorter table name alias.
1 parent f5e9438 commit 4106405

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/EloquentDataTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,18 @@ protected function joinEagerLoadedColumn($relation, $relationColumn)
169169

170170
case $model instanceof BelongsTo:
171171
$table = $model->getRelated()->getTable();
172-
$alias = "alias_{$index}_{$table}";
172+
$alias = "{$table}_{$index}";
173173
$tableAs = "{$table} AS {$alias}";
174174
$foreign = $model->getQualifiedForeignKeyName();
175-
$owner = "{$alias}.{$model->getOwnerKeyName()}";
175+
$other = "{$alias}.{$model->getOwnerKeyName()}";
176176
$deletedAt = $this->checkSoftDeletesOnModel($model->getRelated());
177177

178178
break;
179179

180180
default:
181181
throw new Exception('Relation ' . get_class($model) . ' is not yet supported.');
182182
}
183-
$this->performJoin($tableAs ?? $table, $foreign, $owner ?? $other, $deletedAt);
183+
$this->performJoin($tableAs ?? $table, $foreign, $other, $deletedAt);
184184
$lastQuery = $model->getQuery();
185185
}
186186

0 commit comments

Comments
 (0)