F
Filament8mo ago
Zen

How to cast type from Enum back to string when export to excel

I am trying to export to excel using the built-in ExportAction. The status data was casted in the Model to Enum. Now , it the export filed, it should be string. How I can cast back to string. #excel #export #enum #cast
No description
No description
No description
Solution:
ExportColumn::make('status')->formatStateUsing(function ($state) { return $state->getLabel(); }),...
Jump to solution
1 Reply
Solution
Zen
Zen8mo ago
ExportColumn::make('status')->formatStateUsing(function ($state) { return $state->getLabel(); }),
Want results from more Discord servers?
Add your server