© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
9 replies
Yatendra

Select option Concat

I want to show options with item_price and item_number combine

like below

J94UUdLL-(5000)
Solution
In options you can return any array/collection so you just need to write your own logic in there to get an array of keys/values as you would any other way in PHP/Laravel.

You could use mapWithKeys to achieve this, something like this would work:
Select::make('author_id')
    ->label('Author')
    ->options(Lead::all()->mapWithKeys(function ($lead) {
        return [$lead->id => $lead->lead_name.'-('.$lead->lead_price.')'];
    }))
Select::make('author_id')
    ->label('Author')
    ->options(Lead::all()->mapWithKeys(function ($lead) {
        return [$lead->id => $lead->lead_name.'-('.$lead->lead_price.')'];
    }))
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Concating Fields in Select Option
FilamentFFilament / ❓┊help
13mo ago
Select option formatting
FilamentFFilament / ❓┊help
12mo ago
Filament Select Option
FilamentFFilament / ❓┊help
3y ago