-gt;order("field(id, 3, 6, 9, 1, 2, 5, 8, 7)")
If you use model query, it is: table Name::where("id","in","3,6,9,1,2,5,8,7")-gt;order("field(id,3,6,9,1,2 ,5,8,7)")-gt;select();
Friends who saw it, please give it a like if it was helpful to you, thank you!