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

[5.x] Run query scopes after all other query methods so the query can be changed #10872

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from

Conversation

ryanmitchell
Copy link
Contributor

This PR updates the collection tag to query scopes after orderBys, which allows the scope to modify the default orderBy set.

For example, in the linked issue, inside the scope you could:

public function apply($query, $values)
{
    $query->reorder('my_column', 'desc');
}

Requires: #10871
Closes #10230

@ryanmitchell ryanmitchell changed the title [5.x] Query scopes after all other query methods so they can be changed [5.x] Run query scopes after all other query methods so they can be changed Oct 1, 2024
@ryanmitchell ryanmitchell changed the title [5.x] Run query scopes after all other query methods so they can be changed [5.x] Run query scopes after all other query methods so they query be changed Oct 1, 2024
@ryanmitchell ryanmitchell changed the title [5.x] Run query scopes after all other query methods so they query be changed [5.x] Run query scopes after all other query methods so the query can be changed Oct 1, 2024
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.

Query Scope can not overwrite orderBy('date')
1 participant