This MR fixes issues with HasOneThrough and HasManyThrough for self-joins.
In this case, the nested select would use the same table name/alias as the outer select.
This MR fixes this by replacing $instance->getTable() with $query->getModel()->getTable(), which contain the correct inner table alias that laravel assigned to it.
This MR fixes issues with
HasOneThrough
andHasManyThrough
for self-joins. In this case, the nested select would use the same table name/alias as the outer select.This MR fixes this by replacing
$instance->getTable()
with$query->getModel()->getTable()
, which contain the correct inner table alias that laravel assigned to it.