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



Solution:Jump to solution
ExportColumn::make('status')->formatStateUsing(function ($state) {
return $state->getLabel();
}),...
1 Reply
Solution
ExportColumn::make('status')->formatStateUsing(function ($state) {
return $state->getLabel();
}),