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
prazerOP2y ago
prazer
prazerOP2y ago
Ayman Alareqi
Ayman Alareqi2y 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
prazerOP2y 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_ibur2y ago
use datalist

Did you find this page helpful?