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.

Updating to the Multi-Sort Beta

  1. Update to the beta To update to the beta update your composer.json file to:
    "archilex/filament-filter-sets": "^3.10@beta",
    
  2. Compile assets After updating run npm run build and php artisan filament:upgrade.
  3. Install Default Views (optional) If you would also like to use the new Default Views, follow these instructions.

Using Multi-Sort

To use multi-sort:
  1. Click the new multi-sort button in the table toolbar to open the multi-sort dropdown.
  2. Click the Add column button to add a column to sort by. Only ->sortable() table columns will be shown.
  3. Use the up and down arrow buttons to change the sort direction.
  4. You may add additional columns and then drag and drop the them in the order you prefer.

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 by passing false to the multiSortEnabled() method:
AdvancedTablesPlugin::make()
    ->multiSortEnabled(false)

Changing the icon

You may change the icon used for the Multi-Sort dropdown using the multiSortIcon() method:
AdvancedTablesPlugin::make()
    ->multiSortIcon('heroicon-s-chevron-up-down')

Hiding the badge

By default, when one or more columns is being sorted, the Multi-Sort dropdown button will display a badge indicating the number of columns that are being sorted. You may hide the badge by passing false to the multiSortBadge() method:
AdvancedTablesPlugin::make()
    ->multiSortBadge(false)

Customizing the buttons and labels

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