Custom sort option

Not sure if I'm missing something but I can't find anything relevant in the docs/online

Is there a way to add a custom sort option, without having the related column appear on the table?

Eg I might want to sort by the ID column, without having the ID visible on the table.

I tried having a hidden column but it didn't work.

TextColumn::make('ID')
  ->hidden()
  ->sortable()


Any idea/tips?
Thanks in advance
Solution
What about

TextColumn::make('ID')
  ->toggleable(isToggledHiddenByDefault: true)
  ->sortable()
Was this page helpful?