Skip to content

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

Closed
@ccharz

Description

@ccharz

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

Activity

tpetry

tpetry commented on Apr 6, 2024

@tpetry
Contributor

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

plumthedev

plumthedev commented on Apr 6, 2024

@plumthedev
Contributor

Sure, I will take a look 👀

github-actions

github-actions commented on Apr 7, 2024

@github-actions

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

plumthedev commented on Apr 7, 2024

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Participants

    @crynobone@tpetry@ccharz@plumthedev

    Issue actions

      [11.2] Global Scopes can't be removed from BelongsToMany relations · Issue #50945 · laravel/framework