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

keizah7's avatar
Level 17

Livewire query string

Is it impossible to have query strings like this with livewire?

https://spatie.be/docs/laravel-query-builder/v3/features/filtering#exact-filters

GET /users?filter[name]=John%20Doe&filter[city]=NY

I tried this way, but it don't work (https://laravel-livewire.com/docs/2.x/query-string) Looks like it doesn't support array values

Also, I tried change url via js

const url = new URL(window.location.href);
const search = new URLSearchParams(url.search);
search.append(`filters[${key}]`, value)
window.history.replaceState({}, '', `${location.pathname}?${search}`);)

It changes url but after $refresh magic action livewire don't see new url in

request()->all()

(patie package can't see filter query string too

I have made datatable with search (alpine.js, livewire) Now I am doing filtering and ordering with spatie/laravel-query-builder but where is problem with reactive query string. Any tips?

0 likes
2 replies

Please or to participate in this conversation.