First attempt at unifying code for categories and budgets, which are basically the same thing.

This commit is contained in:
Sander Dorigo
2014-11-10 21:55:22 +01:00
parent af9473c126
commit 9fa326f630
11 changed files with 417 additions and 393 deletions

View File

@@ -50,6 +50,16 @@ Route::bind(
}
);
Route::bind(
'component', function ($value, $route) {
if (Auth::check()) {
return Component::
where('id', $value)->where('user_id', Auth::user()->id)->first();
}
return null;
}
);
Route::bind(
'reminder', function ($value, $route) {
if (Auth::check()) {
@@ -169,13 +179,18 @@ Route::group(
Route::get('/chart/reports/income-expenses/{year}', ['uses' => 'GoogleChartController@yearInExp']);
Route::get('/chart/reports/income-expenses-sum/{year}', ['uses' => 'GoogleChartController@yearInExpSum']);
Route::get('/chart/reports/budgets/{year}', ['uses' => 'GoogleChartController@budgetsReportChart']);
Route::get('/chart/budgets/{budget}/spending/{year}', ['uses' => 'GoogleChartController@budgetsAndSpending']);
// google chart (categories + budgets)
Route::get('/chart/component/{component}/spending/{year}', ['uses' => 'GoogleChartController@componentsAndSpending']);
// google table controller
Route::get('/table/account/{account}/transactions', ['uses' => 'GoogleTableController@transactionsByAccount']);
Route::get('/table/accounts/{what}', ['uses' => 'GoogleTableController@accountList']);
Route::get('/table/categories', ['uses' => 'GoogleTableController@categoryList']);
Route::get('/table/budget/{budget}/{limitrepetition?}/transactions', ['uses' => 'GoogleTableController@transactionsByBudget']);
// google table (categories + budgets)
Route::get('/table/component/{component}/{limitrepetition}/transactions', ['uses' => 'GoogleTableController@transactionsByComponent']);
Route::get('/chart/home/info/{accountnameA}/{day}/{month}/{year}', ['uses' => 'ChartController@homeAccountInfo', 'as' => 'chart.info']);