Export action with Enum column
Hello, do you know if it's possible to export table when column is type Enum. Thanks
Solution:Jump to solution
Hello, You can export table with enum column.
1. Add cast to you model:
protected function casts(): array
{
return [...
1 Reply
Solution
Hello, You can export table with enum column.
1. Add cast to you model:
protected function casts(): array
{
return [
'identification_type' => IdentificationTypeEnum::class,
];
}
2. Modify state enum column:
ExportColumn::make('identification_type')
->label(__('resources.customer.labels.identification_type'))
->state(fn($record) => $record->identification_type->getLabel()),