Skip to main content
Multi-Sort Advanced Tables now allows your users to sort their tables by multiple columns. Using the new Multi-Sort dropdown, users can add additional columns to sort by, easily change sort direction, and even reorder the columns. And Multi-Sort is completely integrated with Preset Views and User Views.
Note: The multi-sort button will only be displayed when there is at least one sortable column.

Using with Preset Views

You can apply multi-sorting in your Preset Views through the defaultSort() method:
'processing' => PresetView::make()
    ->defaultSort([
        'is_visible' => 'desc',
        'price' => 'asc'
    ])

Multi-Sort configurations

Advanced Tables offers multiple ways to customize Multi-Sort. Unless specified otherwise, these options can be configured directly on the AdvancedTablesPlugin object inside your PanelProvider.

Disabling Multi-Sort

Advanced Tables enables multi-sorting by default. You may disable this globally by passing false to the multiSortEnabled() method:
AdvancedTablesPlugin::make()
    ->multiSortEnabled(false)
You may also configure this per table by overriding the multiSortIsEnabled() method on your List page:
class ListOrders extends ListRecords
{
    use AdvancedTables; 

    public static function multiSortIsEnabled(): bool
    {
        return false;
    }
    ...

Customizing the trigger action

You can customize the Multi-Sort trigger button using multiSortTriggerAction(), following the same pattern as Filament’s trigger action customization:
use Filament\Actions\Action;

AdvancedTablesPlugin::make()
    ->multiSortTriggerAction(function (Action $action) {
        return $action
            ->icon('heroicon-s-chevron-up-down')
            ->tooltip('Sort by multiple columns')
            ->color('primary');
    })

Customizing the buttons and labels

You may customize Multi-Sort buttons, labels in the language file.