@if (data_get($setUp, 'header.toggleColumns')) {{-- Backward-compatible override: if the PowerGrid component exposes a `toggleableColumns()` method returning a non-empty list of field names, the show/hide menu lists ONLY those columns. Otherwise it falls back to PowerGrid's default behavior (all visible columns). This keeps every other table untouched. --}} @php $togglableFields = method_exists($this, 'toggleableColumns') ? $this->toggleableColumns() : []; $toggleColumns = ! empty($togglableFields) ? collect($this->visibleColumns)->whereIn('field', $togglableFields)->values() : $this->visibleColumns; @endphp
    @foreach ($toggleColumns as $column)
  • @if (data_get($column, 'hidden') === false) @else @endif {!! data_get($column, 'title') !!}
  • @endforeach
@endif