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

[8.x] Add fullUrlWithoutQuery method to Request #38482

Merged
merged 2 commits into from
Aug 22, 2021
Merged

[8.x] Add fullUrlWithoutQuery method to Request #38482

merged 2 commits into from
Aug 22, 2021

Conversation

alisaleem27
Copy link
Contributor

It is quite easy to add query parameters to the current url using request()->fullUrlWithQuery() helper. This works really well when you want to add filters to the current url. But it isn't as easy to remove a parameter.

When the current URL is https://example.com/?color=red&shape=square&size=small

request()->fullUrlWithoutQuery('color');
// https://example.com/?shape=square&size=small

request()->fullUrlWithoutQuery(['color', 'size']);
// https://example.com/?shape=square

@alisaleem27 alisaleem27 marked this pull request as ready for review August 20, 2021 16:41
@GrahamCampbell GrahamCampbell changed the title add fullUrlWithoutQuery method to Request [8.x] Add fullUrlWithoutQuery method to Request Aug 20, 2021
@taylorotwell taylorotwell merged commit aa9daa0 into laravel:8.x Aug 22, 2021
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
* add fullUrlWithoutQuery method to Request

* StyleCI fixes
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