Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: HasManyThrough and HasOneThrough not working #105

Merged
merged 1 commit into from
Nov 16, 2022

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
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