I have a query like following and wants to set all Customer with building areas < 500 building_areas on end of my list.
My not working query:
$Customers = Customer::query()->orderBy('id','DESC')
->orderByRaw('(building_areas < 500)','DESC');
How to use Laravels orderByRaw in this case?
question from:https://stackoverflow.com/questions/65950891/how-to-use-laravel-orderbyraw-with-condition