© 2026 Hedgehog Software, LLC

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

Customizing option label from select with relationship

Forms\Components\Select::make('product_id')
    ->label('Product')
    ->relationship('product', 'name', fn (Builder $query) => $query->withTrashed())
    ->searchable()
Forms\Components\Select::make('product_id')
    ->label('Product')
    ->relationship('product', 'name', fn (Builder $query) => $query->withTrashed())
    ->searchable()

Since the relationship includes trashed products, how to modify the option label from e.g:
Laptop
Laptop
to
Laptop (archived)
Laptop (archived)
for trashed products?
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

Select with relationship and custom label
FilamentFFilament / ❓┊help
3y ago
Select All option in relationship Select
FilamentFFilament / ❓┊help
2y ago
Attach with relationship showing different search option label
FilamentFFilament / ❓┊help
3y ago