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

# Make Model Sortable

<Warning>
  Sorting feature of this package is in its infancy and subject to changes.
</Warning>

* Use `Sortable` trait.
* Define `allowedSorts()` method.

```php theme={null}
use IndexZer0\EloquentFiltering\Sort\Traits\Sortable;
use IndexZer0\EloquentFiltering\Sort\Sortable\Sort;

class Product extends Model
{
    use Sortable;

    public function allowedSorts(): AllowedSortList
    {
        return Sort::only(
            Sort::field('name'),
        );
    }
}
```
