Sorting
Sorting Models
Introduction
Basics
- Installation
- Make Model Filterable
- Filtering Models
- Allowing Filters
- Relationships
Available Filters
- Full Filter List
- Field Filters
- Relation Filters
- Morph Relation Filters
- Condition Filters
Digging Deeper
Sorting
Sorting Models
Sorting feature of this package is in its infancy and subject to changes.
$sql = Product::sort([
[
'target' => 'name',
'value' => 'desc',
],
])->toRawSql();
select * from "products" order by "name" desc