diff --git a/docs/features/sorting.md b/docs/features/sorting.md index 9c2cf0f8..7c542d5c 100644 --- a/docs/features/sorting.md +++ b/docs/features/sorting.md @@ -45,6 +45,18 @@ $users = QueryBuilder::for(User::class) // Will retrieve the users sorted descendingly by name ``` +You can define multiple default sorts + +```php +// GET /users +$users = QueryBuilder::for(User::class) + ->defaultSort('-street', 'name') + ->allowedSorts('name', 'street') + ->get(); + +// Will retrieve the users sorted descendingly by street than in ascending order by name +``` + You can sort by multiple properties by separating them with a comma: ```php