title: Laravel comparing Carbon with string date working? is it newly supported?
body: <p>I have the following code working in Laravel 8 (which uses Carbon by default) with PHP7.</p>
  <pre><code>$carbon = new Carbon();
  $test1 = 1;
  $test2 = 1;
  if ($carbon &gt; '1970-01-01 00:00:00') {
      $test1 = 2;
  }
  if ($carbon &gt; '2030-01-01 00:00:00') {
      $test2 = 2;
  }
  # ends with $test1===2 and $test2===1
  </code></pre>
  <p>The problem is that when I searched this usage I found many posts indicating they had to something much more complicated.</p>
  <p><a href="https://stackoverflow.com/questions/50389695/comparing-a-date-with-carbon">Comparing a date with Carbon</a></p>
  <p><a href="https://laracasts.com/discuss/channels/general-discussion/how-to-compare-a-string-with-carbon-date-if-more-than-or-less-than" rel="nofollow noreferrer">https://laracasts.com/discuss/channels/general-discussion/how-to-compare-a-string-with-carbon-date-if-more-than-or-less-than</a></p>
  <p>However all those posts are about 3-4 years old. Is this a newly supported feature of Carbon or my working code was just pure luck and there are cases not working?</p>
  <p>EDIT:
  I found in the <code>greaterThan</code> function implementation that even they are using raw string in the example for their compare-target date. This seems so weird considering all the content of other online posts.</p>
  <pre><code>    /**
       * Determines if the instance is greater (after) than another
       *
       * @example
       * ```
       * Carbon::parse('2018-07-25 12:45:16')-&gt;greaterThan('2018-07-25 12:45:15'); // true
       * Carbon::parse('2018-07-25 12:45:16')-&gt;greaterThan('2018-07-25 12:45:16'); // false
       * Carbon::parse('2018-07-25 12:45:16')-&gt;greaterThan('2018-07-25 12:45:17'); // false
       * ```
       *
       * @param \Carbon\Carbon|\DateTimeInterface|mixed $date
       *
       * @return bool
       */
      public function greaterThan($date): bool
      {
          return $this &gt; $date;
      }
  </code></pre>