title: Laravel Sum a Collection with multiple items
body: <p>I have a model <code>SettlementEntries</code> that has a relation to a sub table <code>return $this-&gt;hasMany('App\Online', 'entry_id');</code></p>
  
  <p>When trying to fetch one single Entry i'm able to sum my collection like in the example below.</p>
  
  <pre><code>$item = SettlementEntries::find($id);
  $item-&gt;Online-&gt;sum('field'); // returns the correct sum
  </code></pre>
  
  <p>My problem starts when the <code>$id</code> is an array, so my result contains 2 SettlementEntries.</p>
  
  <pre><code> $items = SettlementEntries::find($ids);
   $items-&gt;Online-&gt;sum('field'); &lt;- returns zero
  </code></pre>
  
  <p>What is the correct way to retrieve those sums?</p>