© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
CK

Select and TextColumn with Associative Array

use Filament\Forms\Components\Select;
 
Select::make('status')
    ->options([
        -1 => 'Terminated',
        0 => 'Pending',
        1 => 'Approved',
    ]),
use Filament\Forms\Components\Select;
 
Select::make('status')
    ->options([
        -1 => 'Terminated',
        0 => 'Pending',
        1 => 'Approved',
    ]),


May I make and external array like
$status = [
    -1 => 'Terminated',
    0 => 'Pending',
    1 => 'Approved',
]
$status = [
    -1 => 'Terminated',
    0 => 'Pending',
    1 => 'Approved',
]


Select::make('status')
    ->options($status),
Select::make('status')
    ->options($status),

or
Select::make('status')
    ->options($this->status),
Select::make('status')
    ->options($this->status),


and in
TextColumn::make('status'),
TextColumn::make('status'),

how to show the value in state of the key?
eg. when selected -1, show the word 'Terminated' instate of -1.

Thank you
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

using associative array for table/form schema array
FilamentFFilament / ❓┊help
3y ago
Issue with multi-select and $data array
FilamentFFilament / ❓┊help
3y ago
How to show array key in TextColumn
FilamentFFilament / ❓┊help
3y ago