Skip to content

Show/Hide Filters Based on Selected Tab in List Resource #15856

Closed Answered by Murkrow02
Murkrow02 asked this question in Help
Discussion options

You must be logged in to vote

I just solved my original issue like this:

Filter::make('filters')
->form([
CustomerSelect::make('customer_id')
->default(null)
->visible(fn($livewire) => $livewire->activeTab == 'Clienti'),
LaundryAreaSelect::make('laundry_area_id')
->visible(fn($livewire) => $livewire->activeTab != 'Clienti'),
LaundryItemSelect::make('laundry_item_ids')
->reactive()
->multiple()
])

Turns out, the key was injecting the $livewire instance and conditionally showing/hiding the filters based on the active tab!

Replies: 2 comments 1 reply

Comment options

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

Comment options

You must be logged in to vote
0 replies
Answer selected by Murkrow02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants