You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: queries.md
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -590,6 +590,20 @@ The `inRandomOrder` method may be used to sort the query results randomly. For e
590
590
->inRandomOrder()
591
591
->first();
592
592
593
+
#### reorder
594
+
595
+
The `reorder` method allows you to remove all the existing orders and optionally apply a new order. For example, you can remove all the existing orders:
596
+
597
+
$query = DB::table('users')->orderBy('name');
598
+
599
+
$unorderedUsers = $query->reorder()->get();
600
+
601
+
To remove all existing orders and apply a new order, provide the column and direction as arguments to the method:
0 commit comments