title: Laravel how to match 2 values with one field
body: <p>Currently I am facing problem that I am using <code>orWhere</code> to get the correct result but not getting the exact result. I want to get result where my field contain only <strong>Paid</strong> and <strong>Flexible</strong></p>
  
  <p>E.g
  <strong>Status</strong></p>
  
  <ul>
  <li>Paid</li>
  <li>Paid</li>
  <li>Flexible</li>
  <li>Paid</li>
  <li>Paid</li>
  <li>Flexible</li>
  </ul>
  
  <p>But with this query I am also getting <strong>UnPaid</strong> but I don't want <strong>UnPaid</strong> result</p>
  
  <pre><code>$orders = Order::with('orderfiles','orderStatus','orderDelivery','flexibleDelivery')-&gt;whereHas('payment', function ($query) {
              $query-&gt;where("status","=",'Paid')-&gt;orwhere('status' ,'=', 'Flexible');
        })-&gt;whereBetween("tbl_orders.order_date",  $range)-&gt;where('domain_id','=',$domain_id)-&gt;orderBy('order_date','asc')-&gt;paginate();
             return View('admin.all_orders')
                 -&gt;with('orders',$orders)-&gt;with('title','Results - Paid and Flexible Orders')-&gt;with('logoNum',$domain_id);
  </code></pre>
  
  <p><strong>Sql</strong> </p>
  
  <pre><code>Array
  (
      [0] =&gt; select count(*) as aggregate from `tbl_orders` where (select count(*) from `tbl_payments` where `tbl_payments`.`order_id` = `tbl_orders`.`order_id` and `status` = ? or `status` = ?) &gt;= 1 and `tbl_orders`.`order_date` between ? and ? and `domain_id` = ?
      [1] =&gt; Array
          (
              [0] =&gt; Paid
              [1] =&gt; Flexible
              [2] =&gt; 2015-01-01
              [3] =&gt; 2015-05-31
              [4] =&gt; 18
          )
  
      [2] =&gt; 7233.41
      [3] =&gt; mysql
  )
  </code></pre>