Livewire help #1021
-
|
I'm trying to get this working inside Livewire but can't seem to get it to update after an input is typed into. As I type, I can see the url parameter updating. in the The problem is the AJAX call goes to /livewire/update and there are no parameters on it. But the hard refresh does. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
|
Use a separate public property for the filter key: public function updatedFilterReport() Update your component to use this instead of nested arrays: <flux:input placeholder="Search..." icon="magnifying-glass" class="w-2xs!" And in your computed property: #[Computed] If you want to keep it as a nested array: Livewire 3 requires deep reactivity tracking with $this->filter['report']. But #[Url()] doesn’t automatically handle nested keys well in AJAX. You can fix it by adding: protected $updatesQueryString = ['filter.report']; And make sure your input matches: <flux:input wire:model.live.debounce.300ms="filter.report" /> Also, reset pagination on filter changes: public function updatedFilterReport() |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/spatie/laravel-query-builder/blob/main/src/Concerns/FiltersQuery.php#L67 If I dump
|
Beta Was this translation helpful? Give feedback.
-
|
Put this line at the very top of your reports() computed property, before QueryBuilder::for(...): request()->merge([ That’s it. If you want to make it resilient (and avoid empty filters polluting the request): request()->merge([ Then your custom filter will finally fire during AJAX updates without needing a full page refresh. |
Beta Was this translation helpful? Give feedback.


Put this line at the very top of your reports() computed property, before QueryBuilder::for(...):
request()->merge([
'filter' => $this->filter,
]);
That’s it.
This forces the current Livewire filter state into Laravel’s request() object so Spatie’s internals can read it just like it would from a normal GET request.
If you want to make it resilient (and avoid empty filters polluting the request):
request()->merge([
'filter' => array_filter($this->filter),
]);
Then your custom filter will finally fire during AJAX updates without needing a full page refresh.