title: How to create a between date with my check in and check out
body: <p>I'm trying to create a reserve room form. How can I create a between date with my "checkin" and "checkout", that don't allow to send the reservation ticket if already has the specific room reserved between the dates.</p>
  
  <p>Only made it deny if "checkin" or "chekout" is the same day from other confirmed reservation.</p>
  
  <pre><code>$from = Carbon::createFromFormat('d/m/Y', $checkin)-&gt;format('Y-m-d');
  $to = Carbon::createFromFormat('d/m/Y', $checkout)-&gt;format('Y-m-d');
  
  $marcacaocounter1 = Marcacao::where('active', 1)
  -&gt;whereBetween('checkin', [$from, $to])-&gt;count();
  
  $marcacaocounter2 = Marcacao::where('active', 1)
  -&gt;whereBetween('checkout', [$from, $to])-&gt;count();
  
  if($marcacaocounter1 &gt; 0 || $marcacaocounter2 &gt; 0){
      $errors = true;
  
      return response()-&gt;json([
          'errors' =&gt; $errors,
          'errors_msg' =&gt; $errors_msg,
          'success' =&gt; $success,
          'success_msg' =&gt; $success_msg,
          'data' =&gt; $dadosJson]
      );
  
  }
  </code></pre>