title: If with false and 1 value in php
body: <p>I have this code:</p>
  <pre><code>if($coupon-&gt;excluding_discounted){ 
  
     if(!$product-&gt;price_after_discount){
          // do something
    }
  
  }
  </code></pre>
  <p>The code worked perfectly but I thought to convert this to one if ...</p>
  <p><code>dd($coupon-&gt;excluding_discounted,!$product-&gt;price_after_discount);</code></p>
  <pre><code>1
  
  false
  </code></pre>
  <p>How to check if the value of something is 1 and another element is false to do something ...?</p>
  <p><strong>Update:</strong></p>
  <p>my full code:</p>
  <pre><code>$products-&gt;map(function($product) use($coupon){
  
          if($coupon-&gt;excluding_discounted &amp;&amp; !$product-&gt;price_after_discount){
                  user()-&gt;cart()-&gt;updateExistingPivot($product, [
                      'coupon_id' =&gt; $coupon-&gt;id,
                  ]);
          }
  
      });
  </code></pre>
  <p>the logic of code is if the product has discount and the excluding_discounted in coupon is true do the reset of code</p>
  <p>I tried like this but it store the coupon_id even there is a discount on product! but with if inside if worked perfectly</p>