© 2026 Hedgehog Software, LLC

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

Default value in Select input

I want to set one value as default, but the default() is not working. I have had this problem many times. Is there an issue with Select or am I doing something wrong ?

php
Select::make('date_format')
                            ->options([
                                'm/d/Y' => date('m/d/Y'),  // Key is the format, value is the formatted date
                                'n/j/y' => date('n/j/y'),
                                'F j, Y' => date('F j, Y'),
                                'M j, Y' => date('M j, Y'),
                            ])
                            ->default('m/d/Y')  // Set the key as the default, which corresponds to the formatted date
                            ->label('Date Format'),
php
Select::make('date_format')
                            ->options([
                                'm/d/Y' => date('m/d/Y'),  // Key is the format, value is the formatted date
                                'n/j/y' => date('n/j/y'),
                                'F j, Y' => date('F j, Y'),
                                'M j, Y' => date('M j, Y'),
                            ])
                            ->default('m/d/Y')  // Set the key as the default, which corresponds to the formatted date
                            ->label('Date Format'),


this is my code.
Solution
SettingsPage
SettingsPage
is not a
CreatePage
CreatePage
though. I uses already existing data.
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Select field default value
FilamentFFilament / ❓┊help
3y ago
Default value for select
FilamentFFilament / ❓┊help
3y ago
Save default input value in DDBB
FilamentFFilament / ❓┊help
3y ago
Select default value from select dropdown
FilamentFFilament / ❓┊help
17mo ago