Write a query join sum groupby in laravel
<p><br>
Please help me write query.<br>
I have 2 table: "projects" and "debts"<br>
"debts" table have<br></p>

<pre><code>id | project_id | currency_list | total
1  | 1          | 1             | 1000
2  | 1          | 2             | 500
3  | 2          | 1             | 1000
4  | 2          | 2             | 500
...
</code></pre>

<p>I need write query to take 1000 rows from projects and SUM all "total" with group by "currency_list"</p>

<p>Thanks a lot :)</p>