© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•13mo ago
ngaiza_287

CheckboxList inside a Fieldset not saving relationship

I have a checkboxlist in a second fieldset. I get all the options from the ->relationship() but when i save the mode, the relationships do not save in the pivot table.

public static function getForm(): array
    {
        return [
            Fieldset::make('Asset Information')
                ->schema([
                    Select::make('client_id')
                        ->label('Client')
                        ->relationship('client', 'name')
                        ->columnSpanFull()
                        ->searchable()
                        ->preload()
                        ->required(),

                    TextInput::make('name')
                        ->label('Asset Name')
                        ->required(),
                ]),

            Fieldset::make('Asset Watchers')
                ->visible(fn ($record) => is_null($record))
                ->schema([
                    CheckboxList::make('users')
                        ->label('Team members')
                        ->relationship('users', 'name')
                        ->bulkToggleable()
                        ->columnSpanFull()
                        ->searchable()
                        ->required()
                        ->columns(3)
                        ->gridDirection('row')
                        ->hint('Team members that will be notified near expiration')
                        ->searchPrompt('Search for a team member'),
                ]),
        ];
    }
public static function getForm(): array
    {
        return [
            Fieldset::make('Asset Information')
                ->schema([
                    Select::make('client_id')
                        ->label('Client')
                        ->relationship('client', 'name')
                        ->columnSpanFull()
                        ->searchable()
                        ->preload()
                        ->required(),

                    TextInput::make('name')
                        ->label('Asset Name')
                        ->required(),
                ]),

            Fieldset::make('Asset Watchers')
                ->visible(fn ($record) => is_null($record))
                ->schema([
                    CheckboxList::make('users')
                        ->label('Team members')
                        ->relationship('users', 'name')
                        ->bulkToggleable()
                        ->columnSpanFull()
                        ->searchable()
                        ->required()
                        ->columns(3)
                        ->gridDirection('row')
                        ->hint('Team members that will be notified near expiration')
                        ->searchPrompt('Search for a team member'),
                ]),
        ];
    }


My model has the many to many relationship defined.
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

CheckboxList Bug when used inside Fieldset with relationship?
FilamentFFilament / ❓┊help
2y ago
HasOne not saving when using ->relationship() in a Group/Section/Fieldset
FilamentFFilament / ❓┊help
6mo ago
Do not save or exclude Fieldset->relationship() when saving a form?
FilamentFFilament / ❓┊help
3y ago
Relation manager not saving fieldset data
FilamentFFilament / ❓┊help
3y ago