I have two queries, the first one gives me an array of identifiers, which is in a specific order. Then this array of identifiers passes it to the second request, for example:
Operation::whereIn('id', $ids)->get();
But when I output the result of this query, the order changed if the $ ids array was something like (4,2,6,9), which is the order in which I wanted the results to be in, the output will be give me 2, 4,6,9. How can i avoid this?
source share