Skip to content

Conversation

@tsterker
Copy link
Contributor

@tsterker tsterker commented Oct 24, 2022

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 tsterker force-pushed the fix-has-many-through branch from 88328b7 to f304838 Compare October 24, 2022 13:31
@tsterker
Copy link
Contributor Author

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

@calebporzio calebporzio merged commit 5511ee8 into tighten:master Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants