$orderby
The $orderby query option sorts the result set.
Syntax
GET /odata/Products?$orderby=name asc
GET /odata/Products?$orderby=price descDirection
| Direction | Meaning | Default |
|---|---|---|
asc | Ascending (A-Z, 0-9) | Yes (when omitted) |
desc | Descending (Z-A, 9-0) | No |
GET /odata/Products?$orderby=name → ascending (default)
GET /odata/Products?$orderby=name desc → descendingMultiple sort keys
Comma-separated, applied in order:
GET /odata/Products?$orderby=category asc, price descMaps to:
sql
ORDER BY category ASC, price DESCSQL mapping
Each $orderby clause maps to an Eloquent/Query Builder ->orderBy($column, $direction) call. Only direct property references are supported -- expressions in $orderby are not evaluated.