Laravel updating multiple records
<p>I want an help, I need to update multiple rows using row id. </p>

<pre><code>$sortable=$request-&gt;sortable;
    foreach ($sortable as $key =&gt; $id) {
        Category::where('id','=',$id)-&gt;update(['sort_order' =&gt; $key+1]);
    } 
</code></pre>

<p>I find this method not feasible because it updates multiple times.
I want to do the same thing in only one update.</p>

<p>value in sortable is:
0:"2"
1:"1"
2:"4"
3:"3"
4:"5"</p>