© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
Mir Dostogir Ahmed

Dynamic fields based on a select option

Create time select to dynamic input field showing but edit time selected dropdown base input not showing.

         Select::make('type')
                        ->relationship('customerType', 'type')
                        ->live()
                        ->afterStateUpdated(fn (Select $component) => $component
                            ->getContainer()
                            ->getComponent('dynamicTypeFields')
                            ->getChildComponentContainer()
                            ->fill()),

                        Grid::make(2)
                            ->schema(fn (Get $get): array => match ($get('type')) {
                                '1' => self::ipFields(),
                                '2' => self::pppoeFields(),
                                '3' => self::hotspotFields(),
                                default => [],
                            })->key('dynamicTypeFields'),
         Select::make('type')
                        ->relationship('customerType', 'type')
                        ->live()
                        ->afterStateUpdated(fn (Select $component) => $component
                            ->getContainer()
                            ->getComponent('dynamicTypeFields')
                            ->getChildComponentContainer()
                            ->fill()),

                        Grid::make(2)
                            ->schema(fn (Get $get): array => match ($get('type')) {
                                '1' => self::ipFields(),
                                '2' => self::pppoeFields(),
                                '3' => self::hotspotFields(),
                                default => [],
                            })->key('dynamicTypeFields'),
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

Dynamic Fields Based on Select Option Issue
FilamentFFilament / ❓┊help
3y ago
error in Dynamic fields based on a select option
FilamentFFilament / ❓┊help
2y ago
Dynamic fields based on a select option with Tabs
FilamentFFilament / ❓┊help
3y ago
Dynamic Select Fields
FilamentFFilament / ❓┊help
3y ago