Optimised whole budget chart to use less queries.

This commit is contained in:
James Cole
2015-12-29 08:45:43 +01:00
parent 38fe9e7e1c
commit 658265c938
3 changed files with 62 additions and 26 deletions

View File

@@ -32,6 +32,18 @@ interface BudgetRepositoryInterface
*/
public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end);
/**
* Returns the expenses for this budget grouped per month, with the date
* in "date" (a string, not a Carbon) and the amount in "dailyAmount".
*
* @param Budget $budget
* @param Carbon $start
* @param Carbon $end
*
* @return Collection
*/
public function getExpensesPerMonth(Budget $budget, Carbon $start, Carbon $end);
/**
* @param Budget $budget
*