Query Laravel Select WhereIn Array
<p>This query does not work correctly, it only shows 1 row </p>

<pre><code> $data = Post::select('id', 'name')
   -&gt;whereIn('id', [$order])
   -&gt;orderByRaw(\DB::raw("FIELD(id, $order)"))
   -&gt;get();
</code></pre>

<p>but this works fine, it shows all rows</p>

<pre><code>  $data = Post::select('id', 'name')
    -&gt;whereIn('id', [1,2,3])
    -&gt;orderByRaw(\DB::raw("FIELD(id, $order)"))
    -&gt;get();
</code></pre>

<p>Thank you!</p>