Sorting feature of this package is in its infancy and subject to changes.
- Use
Sortabletrait. - Define
allowedSorts()method.
Copy
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'),
);
}
}

