Is there a way to enable sortable on a column that is hidden?

I have a table that has a 'name' column; (in model; name concats first name and last name)

TextColumn::make('name')
->searchable(['first_name', 'last_name'])
->sortable(['last_name']),

However, requirement has come in to enable sorting by first name or last name?

I was thinking I'd add first name and last name as separate columns, enable sortable and hide them. But you can't sort by hidden columns.

(Table uses a split - so has the dropdown for picking filters; rather than clicking headers)

Can't see an obvious solution to this.... hopefully there is one ?
Was this page helpful?