title: Laravel Validation: Validate two dates and times and validate them logicaly
body: <p>I am struggling to set up a proper validation which validates two date inputs and two time inputs. This is my html code so far:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="form-group"&gt;
      &lt;label for="name" class="control-label"&gt;Start date&lt;/label&gt;
      &lt;input type="date" class="form-control" name="start_date"&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label for="name" class="control-label"&gt;Start time&lt;/label&gt;
      &lt;input type="time" class="form-control" name="start_time"&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label for="name" class="control-label"&gt;End date&lt;/label&gt;
      &lt;input type="date" class="form-control" name="end_date"&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label for="name" class="control-label"&gt;End time&lt;/label&gt;
      &lt;input type="time" class="form-control" name="end_time"&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>As you can see, you can enter the start date and start time separated as well as the end date and end time. This can lead to many logical erros such as having an end date + end time bevore the start time + start date or just an end date before a start time.</p>
  
  <p>I want to allow the following combinations (if there is no start_time set it should automatically be set to 00:00 and if there is no end_time set it should automatically be set to 23:59): </p>
  
  <ol>
  <li>start_date</li>
  <li>start_date &amp; start_time</li>
  <li>end_date</li>
  <li>end_date &amp; end_time</li>
  <li>start_date &amp; end_date</li>
  <li>start_date &amp; start_time &amp; end_date</li>
  <li>start_date &amp; end_date</li>
  <li>start_date &amp; start_time &amp; end_date &amp; end_time</li>
  </ol>
  
  <p>This is what I got so far for the rules of my validator:</p>
  
  <pre><code>'start_date' =&gt; ['required_if:start_time,date_format:H:i', 'date', 'nullable'],
  'start_time' =&gt; ['date_format:H:i', 'nullable'],
  'end_date' =&gt; ['required_if:end_time,date_format:H:i', 'date', 'nullable'],
  'end_time' =&gt; ['date_format:H:i', 'nullable'],
  </code></pre>
  
  <p>However, it is not really working and I don't know how to complete it. Any hints and ideas on how to solve my problem?</p>
  
  <p>After I have validated the input the start and end date (+time) should also be validated logicaly. The start date (+time) has to be before the end date (+time).</p>