title: Laravel collection group by with sum
body: <p>I'm trying to group collection by value but also sum nested collection. I'm getting data from google analytics.</p>
  
  <p><a href="https://i.stack.imgur.com/Ss4O2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ss4O2.png" alt="Collection screenshot"></a></p>
  
  <p>For example when you look at Safari (in-app) I just need to sum all values of key 'sessions' in nested collections. How can I do this?
  I have only idea to loop all collections and sum values but that doesnt seems to be good idea.</p>
  
  <p>I want to show table with 2 columns: browser and sessions</p>
  
  <p>Any ideas?</p>