Filter value=null error after refreshing page
I have a simple filter in my Resource's table:
I open the resource table from the url:
http://127.0.0.1:8000/admin/all-orders
This sql query runs:
All good.
Now I set the filter once to something
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=1
I refresh the page, still all good
Than delete the filter, and get to this url:
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=null
I refresh, and no result are shown and this sql query is run:
The service is always an integer, can't be null.
Is it the intended way for the url query to switch to null, in case I delete the filter?
I noticed, that this isn't the case when I never refresh the site, that is what's causing the problem.
I open the resource table from the url:
http://127.0.0.1:8000/admin/all-orders
This sql query runs:
All good.
Now I set the filter once to something
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=1
I refresh the page, still all good
Than delete the filter, and get to this url:
http://127.0.0.1:8000/admin/all-orders?tableFilters[service][value]=null
I refresh, and no result are shown and this sql query is run:
The service is always an integer, can't be null.
Is it the intended way for the url query to switch to null, in case I delete the filter?
I noticed, that this isn't the case when I never refresh the site, that is what's causing the problem.
Solution
This is a known issue with Livewire v3. Filament Issue here: https://github.com/filamentphp/filament/issues/7129
At the bottom there is a workaround you can implement in the meantime.
At the bottom there is a workaround you can implement in the meantime.
GitHub
Package filament/filament Package Version v3 Laravel Version v9.19 Livewire Version v3 PHP Version PHP 8.1 Problem description In v3 when you select a filter, the query string will then populate wi...