If you would like to show/hide columns based on a conditional, you may use the hideIf method on the Column builder:
1Column::make('Special Field')
2 ->hideIf(! auth()->user()->isAdmin());
Note: This only works for the corresponding cells if using the column builder to also build the rest of the table.
#When using 'rowView' to render your cells:
Since rowView does not keep track of the column loop, you must also wrap the same conditional around the cells when using this method:
1@if (! auth()->user()->isAdmin())
2 <x-livewire-tables::table.cell>
3 {{ $row->special_field ?? 'N/A' }}
4 </x-livewire-tables::table.cell>
5@endif