CheckboxList bulkToggleable Reactive

Select::make('country_id')
->label(__('Country'))
->searchable()
->reactive()
->options(Country::all()->pluck('name', 'id')->toArray()),

CheckboxList::make('provinces')
->relationship('provinces', 'name', fn($query, Closure $get) => $query->where('country_id', $get('country_id')))
->bulkToggleable()
->columns(3),
Select::make('country_id')
->label(__('Country'))
->searchable()
->reactive()
->options(Country::all()->pluck('name', 'id')->toArray()),

CheckboxList::make('provinces')
->relationship('provinces', 'name', fn($query, Closure $get) => $query->where('country_id', $get('country_id')))
->bulkToggleable()
->columns(3),
bulkToggleable not working properly πŸ€”
13 Replies
BlackShadow
BlackShadowOPβ€’2y ago
->relationship('provinces', 'name', fn($query, Closure $get) => $query->where('country_id', $get('country_id')))
->relationship('provinces', 'name', fn($query, Closure $get) => $query->where('country_id', $get('country_id')))
Maybe its the clossure πŸ€”
Vp
Vpβ€’2y ago
Is it working only ->relationship('provinces', 'name') like this? for select/deselect all
BlackShadow
BlackShadowOPβ€’2y ago
Yes it only works without the query The correct 'provinces' do show for each country selected which works as intended But i can't deselect
Vp
Vpβ€’2y ago
Compare to docs, you remove Builder before $query.. check this, it may not solve the problem πŸ˜€
BlackShadow
BlackShadowOPβ€’2y ago
->relationship('provinces', 'name', fn(Builder $query, Closure $get) => $query->where('country_id', $get('country_id')))
->relationship('provinces', 'name', fn(Builder $query, Closure $get) => $query->where('country_id', $get('country_id')))
Wont fix it
Vp
Vpβ€’2y ago
I don't know then.. sorry
BlackShadow
BlackShadowOPβ€’2y ago
Mmmm
BlackShadow
BlackShadowOPβ€’2y ago
Seems like i partially fixed it but now its worse 🀣
BlackShadow
BlackShadowOPβ€’2y ago
Still need some help on this
Gorg
Gorgβ€’17mo ago
@blackshadownl Hi, do you fixed this problem?
BlackShadow
BlackShadowOPβ€’17mo ago
No 😦
Gorg
Gorgβ€’17mo ago
@blackshadownl I have same, also tryied but without success...
BlackShadow
BlackShadowOPβ€’17mo ago
Shit..
Want results from more Discord servers?
Add your server