0

I want to order the query value based on status order 8,1,2,3,4,5,6,7.I have the query.Is is possible to sort by given value. I want to order the query result in the given order 8,1,2,3,4,5,6,7

$query->orderBy('status','DESC')  //order by 8,1,2,3,4,5,6,7
->get();
user3386779
  • 6,883
  • 20
  • 66
  • 134

1 Answers1

3

you can use orderByRaw() method

adrianriyadi
  • 385
  • 1
  • 7
  • 17