title: Laravel where in an update statement in the controller
body: <p>I have this function in my controller which works:</p>
  
  <pre><code>foreach($models as $model) {
      if ($model-&gt;EindDatum &lt; Carbon::now() &amp;&amp; $model-&gt;email_send == 0) {
          DB::table('SSL')-&gt;where('userID', Auth::id())-&gt;update(['email_send' =&gt; 1]);
          $model-&gt;user()-&gt;first()-&gt;notify(new \App\Notifications\TaksComplete);
      }
  }
  </code></pre>
  
  <p>Now I would like to change the update statement to this: </p>
  
  <pre><code>DB::table('SSL')-&gt;where('userID', Auth::id(), 'EindDatum' &lt; Carbon::now())-&gt;update(['email_send' =&gt; 1]);
  </code></pre>
  
  <p>But this doesn't work.. its in my where statement but I don't know what I am doing wrong?</p>
  
  <p>But this still updates all of the email_send columns in my database. even though it now should only update the ones in the past.</p>
  
  <p>I dont get an error message</p>