title: Best way to sum time in Laravel?
body: <p>I have a table called <strong>transactions</strong> with two relevant fields to my question, _start_timestamp_ and _end_timestamp_. I need to sum the amount of time passed between all transactions where _end_timestamp_ is not null. So, the result must be something like <em>Total Time of Transactions: 1 hour and 18 minutes</em></p>
  
  <p>I've tried using <em>Carbon</em>, but I don't know how to sum all the lines of the table using it.</p>
  
  <pre><code>foreach($timestampStarts as $timestampStart){  
      $time = new Carbon($timestampStart-&gt;start_timestamp);
      $shift_end_time =new Carbon($timestampStart-&gt;end_timestamp);
      dd($time-&gt;diffForHumans($shift_end_time));
  }
  </code></pre>