Skip to content
Discussion options

You must be logged in to vote

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.

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@sevenpixels
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@sevenpixels
Comment options

@sevenpixels
Comment options

@sevenpixels
Comment options

Answer selected by sevenpixels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants