title: Laravel blade compare two date
body: <p>I would like to compare 2 dates. So I create a condition like this in my template blade:</p>
  
  <pre><code>@if(\Carbon\Carbon::parse($contrat-&gt;date_facturation)-&gt;format('d/m/Y') &lt; $dateNow)
      &lt;td class="danger"&gt;
          {{ \Carbon\Carbon::parse($contrat-&gt;date_facturation)-&gt;format('d/m/Y') }}
      &lt;/td&gt;
  @else
      &lt;td&gt;
          {{ \Carbon\Carbon::parse($contrat-&gt;date_facturation)-&gt;format('d/m/Y') }}
      &lt;/td&gt;
  @endif
  </code></pre>
  
  <p>My variable $dateNow has the same format on my value in $contract->date_facturation</p>
  
  <p><a href="https://i.stack.imgur.com/QDr8J.png" rel="nofollow noreferrer">Screenshot</a></p>
  
  <p>It add a red background on the date 25/02/2018 while the date is not less than the variable $contract->date_facturation</p>
  
  <p>Do you have any idea of ​​the problem? </p>
  
  <p>Thank you</p>