MySQL maneira de ordenar com a mesma ordem em
where in
cláusula:$ids; // array of ids
$placeholders = implode(',',array_fill(0, count($ids), '?')); // string for the query
Operation::whereIn('id', $ids)
->orderByRaw("field(id,{$placeholders})", $ids)->get();