pxlrbt-excel(I am using different roles based on need to export the column fromTable)
I am using the export feature in Filament v2 where I have specified 'fromTable'. However, I need to display the text column based on the user's role. It appears correctly, but it is not functioning as expected with that column. Are there any possibilities in Filament to make a column visible or to use any other condition?
ExportAction::make()
->label(trans('app.students.header_action.export_excel'))
->exports([
ExcelExport::make('table')
->withFilename('Students')
->fromTable()
->withChunkSize(500000),
]),
TextColumn::make('business_name') ->visible(function () { $franchisee = Model::find(Session::get('current_franchisee')); $result = false; if (in_array($franchisee->type, [config('constants.franchisee_types.sm'), config('constants.franchisee_types.so'), config('constants.franchisee_types.sf')])) { $result = true; } return $result; })
TextColumn::make('business_name') ->visible(function () { $franchisee = Model::find(Session::get('current_franchisee')); $result = false; if (in_array($franchisee->type, [config('constants.franchisee_types.sm'), config('constants.franchisee_types.so'), config('constants.franchisee_types.sf')])) { $result = true; } return $result; })
2 Replies
Suspect you'll need to upgrade to v3 before anyone will be able to help
I think this is still a limitation in my plugin and there hasn't been a PR to fix it.