title: Laravel / Eloquent WHERE NOT SUBQUERY
body: <p>I`m having trouble to setup a negative condition like such:</p>
  
  <pre><code>WHERE NOT( "last_day" "&lt;=" $first_day OR "first_day" "&lt;=" $last_day)
  </code></pre>
  
  <p>My query builder looks like this atm:</p>
  
  <pre><code>$query = $query-&gt;where(function ($query) use ($first_day, $last_day) {
     $query-&gt;where('last_day', '&lt;=', $first_day);
     $query-&gt;orWhere('first_day', '&lt;=', $last_day);
  });
  </code></pre>
  
  <p>I would like it to be as such : </p>
  
  <pre><code>$query = $query-&gt;whereNot(function ($query) use ($first_day, $last_day) {
    $query-&gt;where('last_day', '&lt;=', $first_day);
    $query-&gt;orWhere('first_day', '&lt;=', $last_day);
  });
  </code></pre>
  
  <p>To recap: I want an OR statement inside a negative WHERE condition. How can I accomplish this?</p>
  
  <p>source : <a href="http://baodad.blogspot.nl/2014/06/date-range-overlap.html" rel="nofollow noreferrer">http://baodad.blogspot.nl/2014/06/date-range-overlap.html</a></p>