F
Filamentβ€’3mo ago
Mikail

deferLoading

Is there any simple way to actually deferLoading on the table data until filter is applied?
Solution:
You could modify the table query until a filter is selected: Something like this (you need to figure out check_if_empty ```php...
Jump to solution
4 Replies
Solution
Dennis Koch
Dennis Kochβ€’3mo ago
You could modify the table query until a filter is selected: Something like this (you need to figure out check_if_empty
->modifyQueryUsing(fn ($query, $livewire) => $query->when(
check_if_empty($livewire->tableFilters),
fn ($query) => $query->whereRaw('1 = 0')
))
->modifyQueryUsing(fn ($query, $livewire) => $query->when(
check_if_empty($livewire->tableFilters),
fn ($query) => $query->whereRaw('1 = 0')
))
Mikail
Mikailβ€’3mo ago
Thanks so much. modifyQueryUsing worked instead
Dennis Koch
Dennis Kochβ€’3mo ago
Yeah right. Sorry for the "typo". I updated the example
Mikail
Mikailβ€’3mo ago
Awesome πŸ™Œ
Want results from more Discord servers?
Add your server