© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago
ingmontoya

Prefill field

Hey guys, I have a dependent field that needs to be prefilled based on a select, If you check the attached image, it only works with the placeholder option, but when try to use default it doesn't fill the field, what am I doing wrong?
Select::make('variations')
                    ->required()
                    ->translateLabel()
                    ->reactive()
                    ->options(function (callable $get) {
                        $services = Variation::where('service_id', $get('service_id'))->pluck('name', 'price');
                        if ($services) {
                            return $services->toArray();
                        }
                    })
                    ->preload()
                    ->searchable(),
                TextInput::make('price')
                ->placeholder(fn (callable $get) => $get('variations'))
                ->default(fn (callable $get) => $get('variations'))
                ->default(fn (Get $get) => $get('variations'))
Select::make('variations')
                    ->required()
                    ->translateLabel()
                    ->reactive()
                    ->options(function (callable $get) {
                        $services = Variation::where('service_id', $get('service_id'))->pluck('name', 'price');
                        if ($services) {
                            return $services->toArray();
                        }
                    })
                    ->preload()
                    ->searchable(),
                TextInput::make('price')
                ->placeholder(fn (callable $get) => $get('variations'))
                ->default(fn (callable $get) => $get('variations'))
                ->default(fn (Get $get) => $get('variations'))
image.png
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

Prefill field with Get
FilamentFFilament / ❓┊help
2y ago
"Create another" and prefill field
FilamentFFilament / ❓┊help
3y ago
Multi field FieldComponent
FilamentFFilament / ❓┊help
2y ago
Action modal form with many field to prefill
FilamentFFilament / ❓┊help
3y ago