title: Call to a member function when() on integer on laravel update query builder
body: <p>When the 'when' method is only one , the code can work fine.
  But when I use continuous like below I got the error message </p>
  
  <blockquote>
    <p>Call to a member function when() on integer</p>
  </blockquote>
  
  <p>I cannot figure what's the error? Any help is apprecited!</p>
  
  <pre><code>$variable=1;
  
      DB::table('products')
      -&gt;where('id',$p_id)
      -&gt;when($status_0_prop=='true', function($query) use ($variable){
  
              return $query-&gt;update(['status'=&gt;$variable]);
      })
      -&gt;when($queue_number_1_prop=='true', function($query) use ($variable){
  
              return $query-&gt;update(['queue_confirm_1'=&gt;$variable]);
      })
      -&gt;when($queue_number_2_prop=='true', function($query) use ($variable){
  
              return $query-&gt;update(['queue_confirm_2'=&gt;$variable]);
      })
      -&gt;when($queue_number_3_prop=='true', function($query) use ($variable){
  
              return $query-&gt;update(['queue_confirm_3'=&gt;$variable]);
      })
      -&gt;when($img_buy_prop=='true', function($query) use ($variable){
  
              return $query-&gt;update(['img_buy'=&gt;$variable]);
      });
  </code></pre>
  
  <p>or how can I use the Eloquent to eloquent the method?</p>