F
Filament12mo ago
KarlisJ

Can I show bulk action only when a specific filter is selected?

I think I can use the ->vissible and pass closure but not sure which params should I resolve in that Closure and how to use them to achieve this
2 Replies
Kenneth Sese
Kenneth Sese12mo ago
You can do something like:
->visible(fn ($livewire) => $livewire->tableFilters['yourFilter']['value'] === 1))
->visible(fn ($livewire) => $livewire->tableFilters['yourFilter']['value'] === 1))
You might be able to do it with $this-tableFilters but if not then use livewire->tableFilters.
KarlisJ
KarlisJ12mo ago
Perfect, I'll try it once I get to that. Thank you!