F
Filamentβ€’5mo 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β€’5mo 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
MikailOPβ€’4mo ago
Thanks so much. modifyQueryUsing worked instead
Dennis Koch
Dennis Kochβ€’4mo ago
Yeah right. Sorry for the "typo". I updated the example
Mikail
MikailOPβ€’4mo ago
Awesome πŸ™Œ
Want results from more Discord servers?
Add your server