Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

devamit2018's avatar

current url without paging or page =1

how can i get current URL without pagination or page =1? action='{{Request::URL()}}' will give current url something like http://testpdf.oo/admin/students?q=amit&page=2. after clicking button i need to go http://testpdf.oo/admin/students?q=amit and then perform task.

0 likes
4 replies
bashy's avatar
{{ request()->except('page') }}

So, without route() helper

action="{{ request()->url().'?'.http_build_query(request()->except('page')) }}"

with route() helper

action="{{ route('your.route.name', request()->except('page')) }}"
devamit2018's avatar

used first and second option .actually iam using it in search field.after i go to second and third page search dont work since it takes current page link...

Snapey's avatar

In the view you can use $model->url(1) where $model is the paginated model. url(1) asks the paginated model for the base url

Please or to participate in this conversation.