title: Laravel: order by where in
body: <p>I am using SphinxSearch to query some contents and have the ids of my objects that I want to query with MySQL. The array of my ids are sorted depending on their rank Sphinx gives.
  Thus, I would like to make a MySQL like so:</p>
  
  <pre><code>SELECT * FROM table WHERE id IN (1,17,2) 
  ORDER BY FIELD(id,1,17,2)
  </code></pre>
  
  <p>I know I can do:</p>
  
  <pre><code>Table::whereIn('id', $ids)-&gt;get();
  </code></pre>
  
  <p>But I can't get the order I had.</p>
  
  <p>How can I do that in a proper way with Laravel ?</p>