title: Laravel multiple where clause checking for null values through a variable
body: <p>I am storing a where clause in a variable </p>
  
  <pre><code>if($condition === 1) {
      $whereClause = ['mID' =&gt; NULL, 'qid' =&gt; $listing-&gt;lID, 'deleted' =&gt; false];
  }
  else {
      $whereClause= ['mID' =&gt; $member-&gt;mID, 'qid' =&gt; $listing-&gt;lID, 'deleted' =&gt; false];
  }
  </code></pre>
  
  <p>And I get the collection via</p>
  
  <pre><code>$collection = Model::where($whereClause)
  </code></pre>
  
  <p>BUT on the first condition, I actually want the <code>mID</code> to be either 0 or NULL, I want to retrieve items where mID can be 0 or NULL, so I want orWhere clause, which I did use as shown below, but this does not work, gives an error of memory exhausted so something went wrong</p>
  
  <pre><code>if($condition === 1) {
      $whereClause = ['mID' =&gt; NULL, 'qid' =&gt; $listing-&gt;lID, 'deleted' =&gt; false];
      $orWhereClause = ['mID' =&gt; 0, 'qid' =&gt; $listing-&gt;lID, 'deleted' =&gt; false];
  
       $collection = Model::where($whereClause)-&gt;orWhere($orWhereClause)
  
  }
  else {
      $whereClause= ['mID' =&gt; $member-&gt;mID, 'qid' =&gt; $listing-&gt;lID, 'deleted' =&gt; false];
      $collection = Model::where($whereClause)
  
  }
  </code></pre>
  
  <p>Any ideas of how I can achieve this sort of where condition</p>