Skip to content

Commit d3e8791

Browse files
Add reorderByDesc() to Query Builder (#55885)
* Add reorderByDesc() to Query Builder * revert code style change to the original * remove default value for code consistency * Update Builder.php --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent 64e6470 commit d3e8791

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Illuminate/Database/Query/Builder.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,17 @@ public function reorder($column = null, $direction = 'asc')
28562856
return $this;
28572857
}
28582858

2859+
/**
2860+
* Add descending "reorder" clause to the query.
2861+
*
2862+
* @param \Closure|\Illuminate\Database\Query\Builder|\Illuminate\Contracts\Database\Query\Expression|string|null $column
2863+
* @return $this
2864+
*/
2865+
public function reorderDesc($column)
2866+
{
2867+
return $this->reorder($column, 'desc');
2868+
}
2869+
28592870
/**
28602871
* Get an array with all orders with a given column removed.
28612872
*

0 commit comments

Comments
 (0)