© 2026 Hedgehog Software, LLC

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

Select first item

Hey,

I would like to select the first option item, but somehow it isn't working as expected. UI wise, I get the result when I use
->selectablePlaceholder(false)
->selectablePlaceholder(false)
. But the form throws a validation required error on that field.

                Forms\Components\Select::make('project_id')
                    ->relationship(
                        name: 'project',
                        titleAttribute: 'title',
                        modifyQueryUsing: fn (Builder $query) => $query->whereHas('users', fn ($q) => $q->where('user_id', auth()->id()))->orderBy('title')
                    )
                    ->label('Projekt')
                    ->columnSpanFull()
                    ->selectablePlaceholder(false)
                    ->required(),
                Forms\Components\Select::make('project_id')
                    ->relationship(
                        name: 'project',
                        titleAttribute: 'title',
                        modifyQueryUsing: fn (Builder $query) => $query->whereHas('users', fn ($q) => $q->where('user_id', auth()->id()))->orderBy('title')
                    )
                    ->label('Projekt')
                    ->columnSpanFull()
                    ->selectablePlaceholder(false)
                    ->required(),


What am I doing wrong?

Bye
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

TextColumn relation first item
FilamentFFilament / ❓┊help
3y ago
Select automatically select the first one
FilamentFFilament / ❓┊help
2y ago
Remove "remove item" on select
FilamentFFilament / ❓┊help
2y ago
Multiple select displays only one item
FilamentFFilament / ❓┊help
3y ago