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: states eloquent scopes return affects query building #10301

Closed
wants to merge 1 commit into from

Conversation

Hyrran
Copy link

@Hyrran Hyrran commented Apr 1, 2025

States that you need to use Model::query() if your scope has a void return.

Might cause some confusion, as the docs does not use the query() method and the scopes return is void.

states that you need to use Model::query() if your scope has a void return
@Hyrran Hyrran changed the title fix: states scopes return affects query building fix: states eloquent scopes return affects query building Apr 1, 2025
@Hyrran
Copy link
Author

Hyrran commented Apr 1, 2025

I don't know if this is the expected behavior, but @newtonjob has some good points that we could prevent this kind of confusion.
laravel/framework#54450 (comment)

@shaedrich
Copy link
Contributor

shaedrich commented Apr 2, 2025

Not sure if changing the docs is the right approach here. It's unfortunate that some devs have this problem right now in using the attribute, but this might be fixed soon when laravel/framework#55246 is merged, I'd assume.

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.

3 participants