CK
CK
FFilament
Created by CK on 9/22/2024 in #❓┊help
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
6 replies