I need to get Records so that an array of ids come at top of the collection.
$ids = [15, 20];
I tried :
$list = $list->orderByRaw("field(id,".implode(',',$id).")");
But this is working only with whereIn :
$list = $list->whereIn('id',$ids)->orderByRaw("field(id,".implode(',',$id).")");
But I need to fetch all records but Ids 15 and 20 at the top. How to achieve this.