> ## Documentation Index
> Fetch the complete documentation index at: https://docs.advancedtables.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Sort

> Enable users to sort tables by multiple columns with drag-and-drop reordering, fully integrated with Preset and User Views.

![Multi-Sort](https://advancedtables.com/images/multi-sort.png)

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](/v3/features/preset-views) and [User Views](/v3/features/user-views).

## Updating to the Multi-Sort Beta

1. Update to the beta

   To update to the beta update your `composer.json` file to:

   ```json theme={null}
   "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](/v3/features/managed-default-views#updating-to-the-managed-default-views-beta).

## 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](/v3/features/preset-views) through the `defaultSort()` method:

```php theme={null}
'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:

```php theme={null}
AdvancedTablesPlugin::make()
    ->multiSortEnabled(false)
```

### Changing the icon

You may change the icon used for the Multi-Sort dropdown using the `multiSortIcon()` method:

```php theme={null}
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:

```php theme={null}
AdvancedTablesPlugin::make()
    ->multiSortBadge(false)
```

### Customizing the buttons and labels

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