tighten / parental

Use single table inheritance in your Laravel app
MIT License
1.36k stars 98 forks source link

fix: HasManyThrough and HasOneThrough not working #105

Closed tsterker closed 1 year ago

tsterker commented 1 year ago

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.

tsterker commented 1 year ago

@JustSteveKing @calebporzio Friendly poke: Is there a chance to have this reviewed and potentially merged?