title: Laravel update multi rows using whereIn
body: <p>I have ids in a string through ajax,</p>
  
  <p>example:</p>
  
  <pre><code>"1,2"
  </code></pre>
  
  <p>and in my controller, I would like to update multiple rows of a product in one query using <strong>whereIn</strong> with id => <code>[1,2]</code>.</p>
  
  <p><strong>ajax:</strong></p>
  
  <pre><code>$('#add_product').click(function() { 
     var id = $('#get_value').val();
      $.ajax({
          type: 'POST',
          url: "{{action('ProductController@updateProduct')}}",
          data: {
          id: id
          },
       success: function(data){
            alert("success");
       }
      });
  });
  </code></pre>
  
  <p><strong>Controller :</strong></p>
  
  <pre><code>public function updateProduct(Request $request){
   $test_value = collect($request-&gt;id);
   $updateProduct = Product::whereIn('id',$test_value)
                    -&gt;update(['title' =&gt; 'My title']);
  }
  </code></pre>
  
  <p>But i have this error in the network : </p>
  
  <p><strong>SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: '1,2' (SQL: update "products" set "title" = "My title" where "id" in (1,2))</strong></p>