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

Mikegk's avatar

pageName won't work

I'm trying to add a pagination name to my Eloquent Query, but its still "page" in the query.

$this->user->groupsMember()->orderBY('user_updated_at','DESC')->paginate(20,['*'],'groupsWidgetMember');

What's wrong?

0 likes
7 replies
Mikegk's avatar

@Sinnbeck by clicking it.

//Lets assume the variable is $groups...
@if($groups->haspages())
                    <div>
                        {{$groups->links()}}
                    </div>
                @endif

...the links are created and clickable. ?page=x is beeing added to the query. The result doesn't change.

Snapey's avatar

You've put this as a Livewire question. How is the paginator name relevant ?

Mikegk's avatar

@snapey I'm using multiple components that use pagination links.

Mikegk's avatar

...it works without the pagination parameters:

$this->user->groupsMember()->orderBY('user_updated_at','DESC')->paginate(20);

But it still appends '?page=123' to the query string. Can I prevent to built up a query string using livewire somehow?

I know there is this property

protected $queryString = [
        'page' => ['except' => 1, 'as' => 'p'],
    ];

Does it has any options to prevent appending the ?page to the current url in the browser?

Mikegk's avatar

Yes - it's setting the correct name, I also figured out (see my last post). Can I hide the '?page=X' somehow? It's beeing hidden when used "except" for the page number that follows ahead e.g "1".

Please or to participate in this conversation.