-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.4] Add orderByDesc() to Query Builder #18292
Conversation
👍 |
So I'm on the fence about this... If we introduce Then I think, maybe a magic method, that does like Thoughts? |
I don't think so.
|
actually Laravel already provide |
orderByDesc() is more rememberable than latest()... |
{ | ||
$this->orderBy($column, 'desc'); | ||
|
||
return $this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use
public function orderByDesc($column)
{
return $this->orderBy($column, 'desc');
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you go @CupOfTea696 #18465
Thanks. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would be perfect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Just a shortcut of something that I use a lot.