Laravel groupby and orderby together

In Laravel, it’s confusing to use groupby and orderby together. Today, I will show you a little trick, so that you can easily use that.