8000 skip appending page=1 in pagination URLs by safaeean · Pull Request #55772 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

skip appending page=1 in pagination URLs #55772

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

Draft
wants to merge 1 commit into
base: 12.x
Choose a base branch
from

Conversation

safaeean
Copy link

feat(pagination): omit ?page=1 and prevent dangling separators

Skip adding the page query parameter when the requested page equals 1, returning the canonical base path instead.

When no extra query parameters are present, the function now suppresses the ? / & separator entirely. This prevents URLs such as /users? or /users& and avoids duplicate‑content issues for the first page.

Behaviour for pages >1 and for existing custom query strings is unchanged.

feat(pagination): omit ?page=1 and prevent dangling separators

Skip adding the `page` query parameter when the requested page equals 1,
returning the canonical base path instead.

When no extra query parameters are present, the function now suppresses
the `?` / `&` separator entirely. This prevents URLs such as
`/users?` or `/users&` and avoids duplicate‑content issues for the first
page.

Behaviour for pages >1 and for existing custom query strings is
unchanged.
@crynobone
Copy link
Member

Mark as draft since test are failing.

@crynobone crynobone marked this pull request as draft May 19, 2025 08:52
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.

2 participants
0