© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
vahnmarty

Apply changes to field's sibling from Repeater

Using a column called
is_primary_contact
is_primary_contact
to a Parent model, I want to use $set() to apply changes to all of the parents. There can be only 1 primary contact, so If I set the parent1 to
is_primary_contact
is_primary_contact
, the rest of the parents should be
false
false
.

Select::make('is_primary_contact')
                        ->label('Is this parent the Primary Contact? (Only 1 parent can be the Primary Contact)')
                        ->options([
                            1 => 'Yes',
                            0 => 'No'
                        ])
                        ->required()
                        ->reactive()
                        ->afterStateUpdated(function(Closure $get, Closure $set, $state){

                            if($state == 1)
                            {   
                                $parentsRepeater = $get('../../parents');

                                foreach($parentsRepeater as $repeaterItemUuid => $parentItem)
                                {
                                    // How??
                                }
                            }
                            
                            $this->autoSaveParent($get('id'),'is_primary_contact', $state);
                        }),
Select::make('is_primary_contact')
                        ->label('Is this parent the Primary Contact? (Only 1 parent can be the Primary Contact)')
                        ->options([
                            1 => 'Yes',
                            0 => 'No'
                        ])
                        ->required()
                        ->reactive()
                        ->afterStateUpdated(function(Closure $get, Closure $set, $state){

                            if($state == 1)
                            {   
                                $parentsRepeater = $get('../../parents');

                                foreach($parentsRepeater as $repeaterItemUuid => $parentItem)
                                {
                                    // How??
                                }
                            }
                            
                            $this->autoSaveParent($get('id'),'is_primary_contact', $state);
                        }),
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

Set Value of Sibling Repeater Field from Form Event?
FilamentFFilament / ❓┊help
3y ago
Repeater immediately change field after another field changes
FilamentFFilament / ❓┊help
3y ago
Refresh repeater from child field
FilamentFFilament / ❓┊help
2y ago
Repeater Select Morph - disable sibling options
FilamentFFilament / ❓┊help
15mo ago