Filament Table column hidden with condition
I have this two columns:
TextColumn::make('column_one')
->sortable(),
TextColumn::make('column_two')
->sortable()
->searchable(),
If column_one equals to 1, then hide column_one and show column_two
If column_one different from 1, then hide column_two
TextColumn::make('column_one')
->sortable(),
TextColumn::make('column_two')
->sortable()
->searchable(),
If column_one equals to 1, then hide column_one and show column_two
If column_one different from 1, then hide column_two
Solution
You should use this https://filamentphp.com/docs/3.x/tables/columns/getting-started#calculated-state
You can't show/hide columns by row values
You can't show/hide columns by row values