F
Filament5mo ago
Jakub

How to access $table current `group by` filter? So I can dynamically hide columns

When I have the group by status I want to make the columns hidden like this
No description
3 Replies
Jakub
Jakub5mo ago
If I disable the grouping, or switch it to something else. for the status to show up
No description
Jakub
Jakub5mo ago
Tables\Columns\TextColumn::make('status')
->badge()
->sortable()
->hidden(
function (BaseFilter $filter) {
dd($filter);
}
)
Tables\Columns\TextColumn::make('status')
->badge()
->sortable()
->hidden(
function (BaseFilter $filter) {
dd($filter);
}
)
I am trying diffrent stuff in https://filamentphp.com/docs/3.x/tables/filters#injecting-the-current-filter-instance But no idea honstly how to access the $table->current group
Jakub
Jakub5mo ago
If I am missing something in the docs, would be very helpful if you can point me in that direction If something like this is possible
->hidden(function (Table $table) {
if ($table->getGroup('status')) {
return true;
}
}),
->hidden(function (Table $table) {
if ($table->getGroup('status')) {
return true;
}
}),
Want results from more Discord servers?
Add your server
More Posts