F
Filament16mo ago
prazer

How to Enum on TextColumn method?

TextColumn::make('agrupamento')
->label('Agrupamento')
->sortable(),
TextColumn::make('agrupamento')
->label('Agrupamento')
->sortable(),
Select::make('agrupamento')
->required()
->options(PropertyAgrupament::class),
Select::make('agrupamento')
->required()
->options(PropertyAgrupament::class),
How method i need to use on TextColumn to get the same result of the select?
6 Replies
prazer
prazerOP16mo ago
prazer
prazerOP16mo ago
Ayman Alareqi
Ayman Alareqi16mo ago
You should add the cast to your model like this
use App\Enums\PropertyAgrupament;

protected $casts = [
'agrupamento' => PropertyAgrupament::class,
];
use App\Enums\PropertyAgrupament;

protected $casts = [
'agrupamento' => PropertyAgrupament::class,
];
prazer
prazerOP16mo ago
@aymanalareqi Its already there.
protected $casts = [
'agrupamento' => PropertyAgrupament::class
];
protected $casts = [
'agrupamento' => PropertyAgrupament::class
];
In my method ->options() it works, however, in TextColumn it doesn't
xcal_ibur
xcal_ibur16mo ago
use datalist
Want results from more Discord servers?
Add your server