Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Eloquent cursor pagination doesn't apply global scopes correctly with unions#55751

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
thijsvdanker wants to merge1 commit intolaravel:12.x
base:12.x
Choose a base branch
Loading
fromthijsvdanker:fix-eloquent-union-cursor-pagination-with-global-scopes

Conversation

thijsvdanker
Copy link
Contributor

When using:

  • Eloquent builder
  • cursor pagination
  • unions on models that have global scopes

the global scopes are not applied correctly to the union queries, resulting in to little columns in the resulting query.
This causes either an error from the database that the number of columns / bindings have a mismatch (SQLite) or the bindings are applied to the wrong columns (SQL Server).

When usingtoBase() on the union query this issue goes away.
I don't know what the right moment would be toapplyScopes on the union query so don't know how to work on a fix for this issue.

@thijsvdankerthijsvdankerforce-pushed thefix-eloquent-union-cursor-pagination-with-global-scopes branch fromd1d764e toad7bd37CompareMay 16, 2025 11:59
@taylorotwelltaylorotwell marked this pull request as draftMay 16, 2025 14:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@thijsvdanker

[8]ページ先頭

©2009-2025 Movatter.jp