laravel OrderBy and sum
<p>This question seems so silly but it's annoying me.</p>

<pre><code> ----------------------------------------------------------------
 | account_id | order_id | sales | profit | currency | date     |
 |---------------------------------------------------|-----------
 |    10      |   100    | 550   |  10    | USD      |2016-10-11|
 |    10      |   101    | 144   |  4     | NZD      |2016-10-12|
 |    9       |   102    | 429   |  44    | NZD      |2016-10-13|
 |    10      |   103    | 797   |  80    | NZD      |2016-10-14|
 ----------------------------------------------------------------
</code></pre>

<p>I want to sum of profit by currency</p>

<pre><code>$account = App\Account::find(10);

$collection = $account
                -&gt;orders()                # relation between order and account
                -&gt;completedLastMonth()    # scope of dates,
                -&gt;groupBy('currency')     # group by currency
                -&gt;sum('profit')           # sum of profit
</code></pre>

<p>but the <code>$collection</code> is 94.</p>

<p>So I want result something like this</p>

<pre><code>$collection = [
    'USD' =&gt; 10,       # total profit of USD 10 for account 10
    'NZD' =&gt; 84        # total profit of NZD 80 + 4 = 84 for account 10
]
</code></pre>

<p><strong>I have logic of relation between account and Orders and Last Month Scope, Please help me for Aggregate SUM and GROUP BY</strong></p>