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

[11.2] Global Scopes can't be removed from BelongsToMany relations #50945

Closed
ccharz opened this issue Apr 6, 2024 · 4 comments · Fixed by #50953
Closed

[11.2] Global Scopes can't be removed from BelongsToMany relations #50945

ccharz opened this issue Apr 6, 2024 · 4 comments · Fixed by #50953

Comments

@ccharz
Copy link
Contributor

ccharz commented Apr 6, 2024

Laravel Version

v11.2.0

PHP Version

8.3

Database Driver & Version

Sqlite

Description

As stated in #50849 (comment) global scopes can currently not be removed from BelongsToMany relations, because the getGrammar() is unnecessarily forwarded to the query builders toBase method which directly applies the scopes.

Steps To Reproduce

https://github.com/ccharz/laravel-belongs-to-many-without-scopes/commit/e737068e69cb5780eba74579b77c9b055e708bfd

@tpetry
Copy link
Contributor

tpetry commented Apr 6, 2024

@plumthedev can you have a look at this? Seems to be triggered by your change.

@plumthedev
Copy link
Contributor

Sure, I will take a look 👀

Copy link

github-actions bot commented Apr 7, 2024

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@plumthedev
Copy link
Contributor

@ccharz Thanks for your eagle eye 👏
I have fixed that - code is under review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants