© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Matthew

How can I set the default value of a Select, when its hidden?

                    Select::make('status')
                        ->label('Status')
                        ->options(Status::all()->pluck('name', 'id'))
                        ->searchable()
                        ->default(Status::where('name', 'Pending')->first()->id)
                        ->hiddenOn(['create','edit']),
                       // ->hiddenOn('create',),
                        // ->disabled(!auth()->user()->can('status_expense')),
                    Select::make('status')
                        ->label('Status')
                        ->options(Status::all()->pluck('name', 'id'))
                        ->searchable()
                        ->default(Status::where('name', 'Pending')->first()->id)
                        ->hiddenOn(['create','edit']),
                       // ->hiddenOn('create',),
                        // ->disabled(!auth()->user()->can('status_expense')),


It shows up as null on the table
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

default value when hidden()
FilamentFFilament / ❓┊help
2y ago
Can I set default value of toggle?
FilamentFFilament / ❓┊help
3y ago
set default value for select
FilamentFFilament / ❓┊help
3y ago
How can I set a default value for a Select field in a Filament form when editing a record?
FilamentFFilament / ❓┊help
12mo ago