© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago•
2 replies
Carlos

CheckboxList not working on Edit

Hello, I have this Checkbox list field that depends of the value of another field:

Forms\Components\CheckboxList::make('countries')
                    ->relationship('countries', 'name')
                    ->visible(fn (Get $get) => $get('applies_to_relationship') === 'countries'),
Forms\Components\CheckboxList::make('countries')
                    ->relationship('countries', 'name')
                    ->visible(fn (Get $get) => $get('applies_to_relationship') === 'countries'),
`

And in my model I have this relationship:

public function countries(): BelongsToMany
    {
        return $this->belongsToMany(Country::class, 'countries_campaigns', 'campaigns_id', 'countries_id');
    }
public function countries(): BelongsToMany
    {
        return $this->belongsToMany(Country::class, 'countries_campaigns', 'campaigns_id', 'countries_id');
    }


When I create a resource it works, and saves the related records, but when I try to edit a record it doesn't store the changes and wipes out any previous related record. How can I address this?

Thank you
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dependent CheckboxList not working
FilamentFFilament / ❓┊help
3y ago
CheckboxList bulkToggleable is not working
FilamentFFilament / ❓┊help
3y ago
CheckboxList ->in() validation not working
FilamentFFilament / ❓┊help
16mo ago
Edit not working
FilamentFFilament / ❓┊help
3y ago