title: Need free time slots from dynamic time in laravel
body: <p>There is one pitch and pitch has its own start time and end time (e.g from 8:00 AM to 7:00 PM).
  And multiple matches has already been scheduled on pitch with some time. (e.g from 8:30AM to 9:00AM, 10:00 AM to 10:30 AM)
  So now what i want to calculate is available time on pitch. 
  My code is here:</p>
  
  <pre><code>$pitchStart = '2018-06-11 08:00 AM';
  $pitchClose = '2018-06-11 09:00 PM';
  
  $firstGameStart = '2018-06-11 09:30 AM';
  $firstGameEnd = '2018-06-11 10:00 AM';
  
  $secondGameStart = '2018-06-11 10:00 AM';
  $secondGameEnd = '2018-06-11 10:30 AM';
  
  $thirdGameStart = '2018-06-11 11:00 AM';
  $thirdGameEnd = '2018-06-11 11:30 AM';
  
  
  $Result = [
      [0] =&gt; ['freeSlotStart' =&gt; '2018-06-11 08:00 AM','freeSlotEnd' =&gt; '2018-06-11 09:30 AM'],
      [1] =&gt; ['freeSlotStart' =&gt; '2018-06-11 10:30 AM','freeSlotEnd' =&gt; '2018-06-11 11:00 AM'],
      [2] =&gt; ['freeSlotStart' =&gt; '2018-06-11 11:30 AM','freeSlotEnd' =&gt; '2018-06-11 09:00 PM'],
  ];
  </code></pre>