Skip to content

Conversation

@bryceray1121
Copy link
Contributor

Encountered an issue when using whereHas inside a globalScope. When the global scope runs on the parent it calls whereHas which gets the related object which then gets the parents query object and runs the scope again. This results in a loop. Fixing this involves getting a scopeless query object from the parent when adding the relation in the whereHas. The global scope will still be applied to the parent object in its own right, just not apart of the relation building mechanism.

@GrahamCampbell
Copy link
Collaborator

Please fix on 4.2 and update the tests.

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