mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-22 20:16:22 +00:00 
			
		
		
		
	Cleanup routes and code.
This commit is contained in:
		| @@ -24,8 +24,10 @@ declare(strict_types=1); | ||||
| // Cron job API routes: | ||||
| Route::group( | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => '', | ||||
|         'as'        => 'api.v1.cron.'], | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\System', | ||||
|         'prefix'    => '', | ||||
|         'as'        => 'api.v1.cron.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('{cliToken}', ['uses' => 'CronController@cron', 'as' => 'index']); | ||||
|     } | ||||
|   | ||||
							
								
								
									
										288
									
								
								routes/api.php
									
									
									
									
									
								
							
							
						
						
									
										288
									
								
								routes/api.php
									
									
									
									
									
								
							| @@ -38,8 +38,11 @@ declare(strict_types=1); | ||||
|  * V2 API route for TransactionList API endpoints | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\Transaction\List', 'prefix' => 'v2', | ||||
|      'as'        => 'api.v2.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\Transaction\List', | ||||
|         'prefix'    => 'v2', | ||||
|         'as'        => 'api.v2.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('accounts/{account}/transactions', ['uses' => 'AccountController@listTransactions', 'as' => 'accounts.transactions']); | ||||
|     } | ||||
| @@ -49,8 +52,11 @@ Route::group( | ||||
|  * V2 API route for net worth endpoint(s); | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers', 'prefix' => 'v2/net-worth', | ||||
|      'as'        => 'api.v2.net-worth.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers', | ||||
|         'prefix'    => 'v2/net-worth', | ||||
|         'as'        => 'api.v2.net-worth.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'NetWorthController@get', 'as' => 'index']); | ||||
|     } | ||||
| @@ -60,8 +66,11 @@ Route::group( | ||||
|  * V2 API routes for charts | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\Chart', 'prefix' => 'v2/chart', | ||||
|      'as'        => 'api.v1.chart.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\Chart', | ||||
|         'prefix'    => 'v2/chart', | ||||
|         'as'        => 'api.v1.chart.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('account/dashboard', ['uses' => 'AccountController@dashboard', 'as' => 'dashboard']); | ||||
|     } | ||||
| @@ -71,8 +80,11 @@ Route::group( | ||||
|  * V2 API route for accounts. | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\Model\Account', 'prefix' => 'v2/accounts', | ||||
|      'as'        => 'api.v2.accounts.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Account', | ||||
|         'prefix'    => 'v2/accounts', | ||||
|         'as'        => 'api.v2.accounts.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('{account}', ['uses' => 'ShowController@show', 'as' => 'show']); | ||||
|     } | ||||
| @@ -82,8 +94,11 @@ Route::group( | ||||
|  * V2 API route for bills. | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\Model\Bill', 'prefix' => 'v2/bills', | ||||
|      'as'        => 'api.v2.bills.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\Model\Bill', | ||||
|         'prefix'    => 'v2/bills', | ||||
|         'as'        => 'api.v2.bills.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('sum/paid', ['uses' => 'SumController@paid', 'as' => 'sum.paid']); | ||||
|         Route::get('sum/unpaid', ['uses' => 'SumController@unpaid', 'as' => 'sum.unpaid']); | ||||
| @@ -93,8 +108,11 @@ Route::group( | ||||
|  * V2 API route for budgets and budget limits: | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\Model', 'prefix' => 'v2/budgets', | ||||
|      'as'        => 'api.v2.budgets',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\Model', | ||||
|         'prefix'    => 'v2/budgets', | ||||
|         'as'        => 'api.v2.budgets', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'Budget\ListController@index', 'as' => 'index']); | ||||
|         Route::get('{budget}', ['uses' => 'Budget\ShowController@show', 'as' => 'show']); | ||||
| @@ -108,8 +126,11 @@ Route::group( | ||||
|  * V2 API route for system | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V2\Controllers\System', 'prefix' => 'v2', | ||||
|      'as'        => 'api.v2.system.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V2\Controllers\System', | ||||
|         'prefix'    => 'v2', | ||||
|         'as'        => 'api.v2.system.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('preferences/{preference}', ['uses' => 'PreferencesController@get', 'as' => 'preferences.get']); | ||||
|     } | ||||
| @@ -119,8 +140,11 @@ Route::group( | ||||
|  * Autocomplete controllers | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Autocomplete', 'prefix' => 'v1/autocomplete', | ||||
|      'as'        => 'api.v1.autocomplete.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Autocomplete', | ||||
|         'prefix'    => 'v1/autocomplete', | ||||
|         'as'        => 'api.v1.autocomplete.', | ||||
|     ], | ||||
|     static function () { | ||||
|         // Auto complete routes | ||||
|         Route::get('accounts', ['uses' => 'AccountController@accounts', 'as' => 'accounts']); | ||||
| @@ -147,8 +171,11 @@ Route::group( | ||||
|  */ | ||||
| // Accounts | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Chart', 'prefix' => 'v1/chart/account', | ||||
|      'as'        => 'api.v1.chart.account.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Chart', | ||||
|         'prefix'    => 'v1/chart/account', | ||||
|         'as'        => 'api.v1.chart.account.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('overview', ['uses' => 'AccountController@overview', 'as' => 'overview']); | ||||
|     } | ||||
| @@ -159,8 +186,11 @@ Route::group( | ||||
|  */ | ||||
| // Export data API routes | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Data\Export', 'prefix' => 'v1/data/export', | ||||
|      'as'        => 'api.v1.data.export.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Data\Export', | ||||
|         'prefix'    => 'v1/data/export', | ||||
|         'as'        => 'api.v1.data.export.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('accounts', ['uses' => 'ExportController@accounts', 'as' => 'accounts']); | ||||
|         Route::get('bills', ['uses' => 'ExportController@bills', 'as' => 'bills']); | ||||
| @@ -175,15 +205,21 @@ Route::group( | ||||
| ); | ||||
| // Destroy data API route | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Data', 'prefix' => 'v1/data/destroy', | ||||
|      'as'        => 'api.v1.data.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Data', | ||||
|         'prefix'    => 'v1/data/destroy', | ||||
|         'as'        => 'api.v1.data.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::delete('', ['uses' => 'DestroyController@destroy', 'as' => 'destroy']); | ||||
|     } | ||||
| ); | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Data', 'prefix' => 'v1/data/purge', | ||||
|      'as'        => 'api.v1.data.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Data', | ||||
|         'prefix'    => 'v1/data/purge', | ||||
|         'as'        => 'api.v1.data.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::delete('', ['uses' => 'PurgeController@purge', 'as' => 'purge']); | ||||
|     } | ||||
| @@ -191,8 +227,11 @@ Route::group( | ||||
|  | ||||
| // Bulk update API routes | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Data\Bulk', 'prefix' => 'v1/data/bulk', | ||||
|      'as'        => 'api.v1.data.bulk.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Data\Bulk', | ||||
|         'prefix'    => 'v1/data/bulk', | ||||
|         'as'        => 'api.v1.data.bulk.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::post('transactions', ['uses' => 'TransactionController@update', 'as' => 'transactions']); | ||||
|     } | ||||
| @@ -204,8 +243,11 @@ Route::group( | ||||
|  | ||||
| // Insight in expenses: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Expense', 'prefix' => 'v1/insight/expense', | ||||
|      'as'        => 'api.v1.insight.expense.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Expense', | ||||
|         'prefix'    => 'v1/insight/expense', | ||||
|         'as'        => 'api.v1.insight.expense.', | ||||
|     ], | ||||
|     static function () { | ||||
|         // Insight in expenses per account: | ||||
|         Route::get('expense', ['uses' => 'AccountController@expense', 'as' => 'expense']); | ||||
| @@ -228,8 +270,11 @@ Route::group( | ||||
| ); | ||||
| // insight in income | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Income', 'prefix' => 'v1/insight/income', | ||||
|      'as'        => 'api.v1.insight.income.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Income', | ||||
|         'prefix'    => 'v1/insight/income', | ||||
|         'as'        => 'api.v1.insight.income.', | ||||
|     ], | ||||
|     static function () { | ||||
|         // Insight in expenses per account: | ||||
|         Route::get('revenue', ['uses' => 'AccountController@revenue', 'as' => 'revenue']); | ||||
| @@ -250,8 +295,11 @@ Route::group( | ||||
|  | ||||
| // Insight in transfers | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Transfer', 'prefix' => 'v1/insight/transfer', | ||||
|      'as'        => 'api.v1.insight.transfer.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Insight\Transfer', | ||||
|         'prefix'    => 'v1/insight/transfer', | ||||
|         'as'        => 'api.v1.insight.transfer.', | ||||
|     ], | ||||
|     static function () { | ||||
|         // Insight in expenses per account: | ||||
|         Route::get('asset', ['uses' => 'AccountController@asset', 'as' => 'asset']); | ||||
| @@ -260,7 +308,6 @@ Route::group( | ||||
|         Route::get('tag', ['uses' => 'TagController@tag', 'as' => 'tag']); | ||||
|         Route::get('no-tag', ['uses' => 'TagController@noTag', 'as' => 'no-tag']); | ||||
|         Route::get('total', ['uses' => 'PeriodController@total', 'as' => 'total']); | ||||
|  | ||||
|         // TODO Transfers for piggies | ||||
|     } | ||||
| ); | ||||
| @@ -269,8 +316,11 @@ Route::group( | ||||
|  */ | ||||
| // BASIC | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Summary', 'prefix' => 'v1/summary', | ||||
|      'as'        => 'api.v1.summary.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Summary', | ||||
|         'prefix'    => 'v1/summary', | ||||
|         'as'        => 'api.v1.summary.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('basic', ['uses' => 'BasicController@basic', 'as' => 'basic']); | ||||
|     } | ||||
| @@ -281,8 +331,11 @@ Route::group( | ||||
|  */ | ||||
| // Accounts API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Account', 'prefix' => 'v1/accounts', | ||||
|      'as'        => 'api.v1.accounts.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Account', | ||||
|         'prefix'    => 'v1/accounts', | ||||
|         'as'        => 'api.v1.accounts.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -298,8 +351,11 @@ Route::group( | ||||
|  | ||||
| // Attachment API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Attachment', 'prefix' => 'v1/attachments', | ||||
|      'as'        => 'api.v1.attachments.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Attachment', | ||||
|         'prefix'    => 'v1/attachments', | ||||
|         'as'        => 'api.v1.attachments.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -313,8 +369,11 @@ Route::group( | ||||
|  | ||||
| // Bills API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Bill', 'prefix' => 'v1/bills', | ||||
|      'as'        => 'api.v1.bills.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Bill', | ||||
|         'prefix'    => 'v1/bills', | ||||
|         'as'        => 'api.v1.bills.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -330,8 +389,11 @@ Route::group( | ||||
|  | ||||
| // Available Budget API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\AvailableBudget', 'prefix' => 'v1/available_budgets', | ||||
|      'as'        => 'api.v1.available_budgets.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\AvailableBudget', | ||||
|         'prefix'    => 'v1/available_budgets', | ||||
|         'as'        => 'api.v1.available_budgets.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         //Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -343,8 +405,11 @@ Route::group( | ||||
|  | ||||
| // Budget and Budget Limit API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models', 'prefix' => 'v1/budgets', | ||||
|      'as'        => 'api.v1.budgets.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models', | ||||
|         'prefix'    => 'v1/budgets', | ||||
|         'as'        => 'api.v1.budgets.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'Budget\ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'Budget\StoreController@store', 'as' => 'store']); | ||||
| @@ -368,8 +433,11 @@ Route::group( | ||||
|  | ||||
| // separate route for budget limits without referring to the budget. | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\BudgetLimit', 'prefix' => 'v1/budget-limits', | ||||
|      'as'        => 'api.v1.budget-limits.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\BudgetLimit', | ||||
|         'prefix'    => 'v1/budget-limits', | ||||
|         'as'        => 'api.v1.budget-limits.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@indexAll', 'as' => 'index']); | ||||
|     } | ||||
| @@ -377,8 +445,11 @@ Route::group( | ||||
|  | ||||
| // Category API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Category', 'prefix' => 'v1/categories', | ||||
|      'as'        => 'api.v1.categories.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Category', | ||||
|         'prefix'    => 'v1/categories', | ||||
|         'as'        => 'api.v1.categories.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -393,8 +464,11 @@ Route::group( | ||||
|  | ||||
| // Object Group API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\ObjectGroup', 'prefix' => 'v1/object_groups', | ||||
|      'as'        => 'api.v1.object-groups.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\ObjectGroup', | ||||
|         'prefix'    => 'v1/object_groups', | ||||
|         'as'        => 'api.v1.object-groups.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::get('{objectGroup}', ['uses' => 'ShowController@show', 'as' => 'show']); | ||||
| @@ -408,8 +482,11 @@ Route::group( | ||||
|  | ||||
| // Piggy Bank API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\PiggyBank', 'prefix' => 'v1/piggy_banks', | ||||
|      'as'        => 'api.v1.piggy_banks.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\PiggyBank', | ||||
|         'prefix'    => 'v1/piggy_banks', | ||||
|         'as'        => 'api.v1.piggy_banks.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -424,8 +501,11 @@ Route::group( | ||||
|  | ||||
| // Recurrence API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Recurrence', 'prefix' => 'v1/recurrences', | ||||
|      'as'        => 'api.v1.recurrences.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Recurrence', | ||||
|         'prefix'    => 'v1/recurrences', | ||||
|         'as'        => 'api.v1.recurrences.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -440,8 +520,11 @@ Route::group( | ||||
|  | ||||
| // Rules API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Rule', 'prefix' => 'v1/rules', | ||||
|      'as'        => 'api.v1.rules.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Rule', | ||||
|         'prefix'    => 'v1/rules', | ||||
|         'as'        => 'api.v1.rules.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -458,8 +541,11 @@ Route::group( | ||||
|  | ||||
| // Rules API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\RuleGroup', 'prefix' => 'v1/rule_groups', | ||||
|      'as'        => 'api.v1.rule_groups.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\RuleGroup', | ||||
|         'prefix'    => 'v1/rule_groups', | ||||
|         'as'        => 'api.v1.rule_groups.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -475,8 +561,11 @@ Route::group( | ||||
|  | ||||
| // Tag API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Tag', 'prefix' => 'v1/tags', | ||||
|      'as'        => 'api.v1.tags.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Tag', | ||||
|         'prefix'    => 'v1/tags', | ||||
|         'as'        => 'api.v1.tags.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -490,8 +579,11 @@ Route::group( | ||||
| ); | ||||
| // Transaction API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Transaction', 'prefix' => 'v1/transactions', | ||||
|      'as'        => 'api.v1.transactions.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Transaction', | ||||
|         'prefix'    => 'v1/transactions', | ||||
|         'as'        => 'api.v1.transactions.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -505,8 +597,11 @@ Route::group( | ||||
| ); | ||||
|  | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\Transaction', 'prefix' => 'v1/transaction-journals', | ||||
|      'as'        => 'api.v1.transaction-journals.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\Transaction', | ||||
|         'prefix'    => 'v1/transaction-journals', | ||||
|         'as'        => 'api.v1.transaction-journals.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('{tj}', ['uses' => 'ShowController@showJournal', 'as' => 'show']); | ||||
|         Route::delete('{tj}', ['uses' => 'DestroyController@destroyJournal', 'as' => 'delete']); | ||||
| @@ -517,8 +612,11 @@ Route::group( | ||||
|  | ||||
| // Transaction currency API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionCurrency', 'prefix' => 'v1/currencies', | ||||
|      'as'        => 'api.v1.currencies.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionCurrency', | ||||
|         'prefix'    => 'v1/currencies', | ||||
|         'as'        => 'api.v1.currencies.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -544,8 +642,11 @@ Route::group( | ||||
|  | ||||
| // Transaction Links API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionLink', 'prefix' => 'v1/transaction_links', | ||||
|      'as'        => 'api.v1.transaction_links.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionLink', | ||||
|         'prefix'    => 'v1/transaction_links', | ||||
|         'as'        => 'api.v1.transaction_links.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -557,8 +658,11 @@ Route::group( | ||||
|  | ||||
| // Transaction Link Type API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionLinkType', 'prefix' => 'v1/link_types', | ||||
|      'as'        => 'api.v1.link_types.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Models\TransactionLinkType', | ||||
|         'prefix'    => 'v1/link_types', | ||||
|         'as'        => 'api.v1.link_types.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
| @@ -573,8 +677,11 @@ Route::group( | ||||
|  * SEARCH ENDPOINTS | ||||
|  */ | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Search', 'prefix' => 'v1/search', | ||||
|      'as'        => 'api.v1.search.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Search', | ||||
|         'prefix'    => 'v1/search', | ||||
|         'as'        => 'api.v1.search.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('transactions', ['uses' => 'TransactionController@search', 'as' => 'transactions']); | ||||
|         Route::get('accounts', ['uses' => 'AccountController@search', 'as' => 'accounts']); | ||||
| @@ -587,8 +694,10 @@ Route::group( | ||||
| // About Firefly III API routes: | ||||
| Route::group( | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => 'v1/about', | ||||
|         'as'        => 'api.v1.about.'], | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\System', | ||||
|         'prefix'    => 'v1/about', | ||||
|         'as'        => 'api.v1.about.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'AboutController@about', 'as' => 'index']); | ||||
|         Route::get('user', ['uses' => 'AboutController@user', 'as' => 'user']); | ||||
| @@ -596,8 +705,11 @@ Route::group( | ||||
| ); | ||||
| // Configuration API routes | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => 'v1/configuration', | ||||
|      'as'        => 'api.v1.configuration.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\System', | ||||
|         'prefix'    => 'v1/configuration', | ||||
|         'as'        => 'api.v1.configuration.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ConfigurationController@index', 'as' => 'index']); | ||||
|         Route::get('{eitherConfigKey}', ['uses' => 'ConfigurationController@show', 'as' => 'show']); | ||||
| @@ -606,8 +718,12 @@ Route::group( | ||||
| ); | ||||
| // Users API routes: | ||||
| Route::group( | ||||
|     ['middleware' => ['auth:api,sanctum', 'bindings'], 'namespace' => 'FireflyIII\Api\V1\Controllers\System', 'prefix' => 'v1/users', | ||||
|      'as'         => 'api.v1.users.',], | ||||
|     [ | ||||
|         'middleware' => ['auth:api,sanctum', 'bindings'], | ||||
|         'namespace'  => 'FireflyIII\Api\V1\Controllers\System', | ||||
|         'prefix'     => 'v1/users', | ||||
|         'as'         => 'api.v1.users.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'UserController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'UserController@store', 'as' => 'store']); | ||||
| @@ -623,8 +739,11 @@ Route::group( | ||||
|  | ||||
| // Preference API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\User', 'prefix' => 'v1/preferences', | ||||
|      'as'        => 'api.v1.preferences.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\User', | ||||
|         'prefix'    => 'v1/preferences', | ||||
|         'as'        => 'api.v1.preferences.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'PreferencesController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'PreferencesController@store', 'as' => 'store']); | ||||
| @@ -635,8 +754,11 @@ Route::group( | ||||
|  | ||||
| // Webhook API routes: | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Api\V1\Controllers\Webhook', 'prefix' => 'v1/webhooks', | ||||
|      'as'        => 'api.v1.webhooks.',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Api\V1\Controllers\Webhook', | ||||
|         'prefix'    => 'v1/webhooks', | ||||
|         'as'        => 'api.v1.webhooks.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']); | ||||
|         Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']); | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| <?php | ||||
|  | ||||
| /** | ||||
|  * breadcrumbs.php | ||||
|  * Copyright (c) 2019 james@firefly-iii.org. | ||||
| @@ -48,7 +49,7 @@ if (!function_exists('limitStringLength')) { | ||||
|     /** | ||||
|      * Cuts away the middle of a string when it's very long. | ||||
|      * | ||||
|      * @param string $string | ||||
|      * @param  string  $string | ||||
|      * | ||||
|      * @return string | ||||
|      */ | ||||
| @@ -58,7 +59,7 @@ if (!function_exists('limitStringLength')) { | ||||
|         $length   = strlen($string); | ||||
|         $result   = $string; | ||||
|         if ($length > $maxChars) { | ||||
|             $result = substr_replace($string, ' ... ', (int) ($maxChars / 2), $length - $maxChars); | ||||
|             $result = substr_replace($string, ' ... ', (int)($maxChars / 2), $length - $maxChars); | ||||
|         } | ||||
|  | ||||
|         return $result; | ||||
| @@ -86,14 +87,14 @@ try { | ||||
|         'accounts.index', | ||||
|         static function (Generator $breadcrumbs, string $what) { | ||||
|             $breadcrumbs->parent('home'); | ||||
|             $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what])); | ||||
|             $breadcrumbs->push(trans('firefly.'.strtolower(e($what)).'_accounts'), route('accounts.index', [$what])); | ||||
|         } | ||||
|     ); | ||||
|     Breadcrumbs::for( // inactive | ||||
|         'accounts.inactive.index', | ||||
|         static function (Generator $breadcrumbs, string $what) { | ||||
|             $breadcrumbs->parent('home'); | ||||
|             $breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts_inactive'), route('accounts.inactive.index', [$what])); | ||||
|             $breadcrumbs->push(trans('firefly.'.strtolower(e($what)).'_accounts_inactive'), route('accounts.inactive.index', [$what])); | ||||
|         } | ||||
|     ); | ||||
|  | ||||
| @@ -101,22 +102,24 @@ try { | ||||
|         'accounts.create', | ||||
|         static function (Generator $breadcrumbs, string $what) { | ||||
|             $breadcrumbs->parent('accounts.index', $what); | ||||
|             $breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what])); | ||||
|             $breadcrumbs->push(trans('firefly.new_'.strtolower(e($what)).'_account'), route('accounts.create', [$what])); | ||||
|         } | ||||
|     ); | ||||
|  | ||||
|     Breadcrumbs::for( | ||||
|         'accounts.show', | ||||
|         static function (Generator $breadcrumbs, Account $account, Carbon $start = null, Carbon $end = null) { | ||||
|             $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); | ||||
|             $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); | ||||
|  | ||||
|             $breadcrumbs->parent('accounts.index', $what); | ||||
|             $breadcrumbs->push(limitStringLength($account->name), route('accounts.show.all', [$account->id])); | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('accounts.show', $account)); | ||||
|             } | ||||
| @@ -126,7 +129,7 @@ try { | ||||
|     Breadcrumbs::for( | ||||
|         'accounts.show.all', | ||||
|         static function (Generator $breadcrumbs, Account $account) { | ||||
|             $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); | ||||
|             $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); | ||||
|  | ||||
|             $breadcrumbs->parent('accounts.index', $what); | ||||
|             $breadcrumbs->push(limitStringLength($account->name), route('accounts.show', [$account->id])); | ||||
| @@ -145,7 +148,7 @@ try { | ||||
|         'accounts.reconcile.show', | ||||
|         static function (Generator $breadcrumbs, Account $account, TransactionJournal $journal) { | ||||
|             $breadcrumbs->parent('accounts.show', $account); | ||||
|             $title = trans('firefly.reconciliation') . ' "' . $journal->description . '"'; | ||||
|             $title = trans('firefly.reconciliation').' "'.$journal->description.'"'; | ||||
|             $breadcrumbs->push($title, route('accounts.reconcile.show', [$journal->id])); | ||||
|         } | ||||
|     ); | ||||
| @@ -162,10 +165,10 @@ try { | ||||
|         'accounts.edit', | ||||
|         static function (Generator $breadcrumbs, Account $account) { | ||||
|             $breadcrumbs->parent('accounts.show', $account); | ||||
|             $what = config('firefly.shortNamesByFullName.' . $account->accountType->type); | ||||
|             $what = config('firefly.shortNamesByFullName.'.$account->accountType->type); | ||||
|  | ||||
|             $breadcrumbs->push( | ||||
|                 trans('firefly.edit_' . $what . '_account', ['name' => limitStringLength($account->name)]), | ||||
|                 trans('firefly.edit_'.$what.'_account', ['name' => limitStringLength($account->name)]), | ||||
|                 route('accounts.edit', [$account->id]) | ||||
|             ); | ||||
|         } | ||||
| @@ -444,8 +447,10 @@ try { | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('budgets.no-budget')); | ||||
|             } | ||||
| @@ -478,8 +483,10 @@ try { | ||||
|  | ||||
|             $title = trans( | ||||
|                 'firefly.between_dates_breadcrumb', | ||||
|                 ['start' => $budgetLimit->start_date->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                  'end'   => $budgetLimit->end_date->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                 [ | ||||
|                     'start' => $budgetLimit->start_date->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     'end'   => $budgetLimit->end_date->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                 ] | ||||
|             ); | ||||
|  | ||||
|             $breadcrumbs->push( | ||||
| @@ -528,8 +535,10 @@ try { | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('categories.show', [$category->id])); | ||||
|             } | ||||
| @@ -553,8 +562,10 @@ try { | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('categories.no-category')); | ||||
|             } | ||||
| @@ -748,10 +759,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_audit', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.audit', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -761,10 +772,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, string $budgetIds, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_budget', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.budget', [$accountIds, $budgetIds, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -775,10 +786,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, string $tagTags, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_tag', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.tag', [$accountIds, $tagTags, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -789,10 +800,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, string $categoryIds, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_category', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_category', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.category', [$accountIds, $categoryIds, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -803,10 +814,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, string $doubleIds, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_double', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_double', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.double', [$accountIds, $doubleIds, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -817,10 +828,10 @@ try { | ||||
|         static function (Generator $breadcrumbs, string $accountIds, Carbon $start, Carbon $end) { | ||||
|             $breadcrumbs->parent('reports.index'); | ||||
|  | ||||
|             $monthFormat = (string) trans('config.month_and_day_js'); | ||||
|             $monthFormat = (string)trans('config.month_and_day_js'); | ||||
|             $startString = $start->isoFormat($monthFormat); | ||||
|             $endString   = $end->isoFormat($monthFormat); | ||||
|             $title       = (string) trans('firefly.report_default', ['start' => $startString, 'end' => $endString]); | ||||
|             $title       = (string)trans('firefly.report_default', ['start' => $startString, 'end' => $endString]); | ||||
|  | ||||
|             $breadcrumbs->push($title, route('reports.report.default', [$accountIds, $start->format('Ymd'), $end->format('Ymd')])); | ||||
|         } | ||||
| @@ -1030,8 +1041,10 @@ try { | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('tags.show', [$tag->id, $start, $end])); | ||||
|             } | ||||
| @@ -1043,7 +1056,7 @@ try { | ||||
|         static function (Generator $breadcrumbs, Tag $tag) { | ||||
|             $breadcrumbs->parent('tags.index'); | ||||
|             $breadcrumbs->push($tag->tag, route('tags.show', [$tag->id])); | ||||
|             $title = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]); | ||||
|             $title = (string)trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]); | ||||
|             $breadcrumbs->push($title, route('tags.show.all', $tag->id)); | ||||
|         } | ||||
|     ); | ||||
| @@ -1054,14 +1067,16 @@ try { | ||||
|         'transactions.index', | ||||
|         static function (Generator $breadcrumbs, string $what, Carbon $start = null, Carbon $end = null) { | ||||
|             $breadcrumbs->parent('home'); | ||||
|             $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); | ||||
|             $breadcrumbs->push(trans('breadcrumbs.'.$what.'_list'), route('transactions.index', [$what])); | ||||
|  | ||||
|             if (null !== $start && null !== $end) { | ||||
|                 // add date range: | ||||
|                 $title = trans( | ||||
|                     'firefly.between_dates_breadcrumb', | ||||
|                     ['start' => $start->isoFormat((string) trans('config.month_and_day_js')), | ||||
|                      'end'   => $end->isoFormat((string) trans('config.month_and_day_js')),] | ||||
|                     [ | ||||
|                         'start' => $start->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                         'end'   => $end->isoFormat((string)trans('config.month_and_day_js')), | ||||
|                     ] | ||||
|                 ); | ||||
|                 $breadcrumbs->push($title, route('transactions.index', [$what, $start, $end])); | ||||
|             } | ||||
| @@ -1072,7 +1087,7 @@ try { | ||||
|         'transactions.index.all', | ||||
|         static function (Generator $breadcrumbs, string $what) { | ||||
|             $breadcrumbs->parent('home'); | ||||
|             $breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what])); | ||||
|             $breadcrumbs->push(trans('breadcrumbs.'.$what.'_list'), route('transactions.index', [$what])); | ||||
|         } | ||||
|     ); | ||||
|  | ||||
| @@ -1093,7 +1108,7 @@ try { | ||||
|             $first = $group->transactionJournals()->first(); | ||||
|  | ||||
|             $breadcrumbs->push( | ||||
|                 trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string) $first->description)]), | ||||
|                 trans('breadcrumbs.edit_journal', ['description' => limitStringLength((string)$first->description)]), | ||||
|                 route('transactions.edit', [$group->id]) | ||||
|             ); | ||||
|         } | ||||
| @@ -1132,7 +1147,7 @@ try { | ||||
|             $type  = strtolower($first->transactionType->type); | ||||
|             $title = limitStringLength($first->description); | ||||
|             if ($group->transactionJournals()->count() > 1) { | ||||
|                 $title = limitStringLength((string) $group->title); | ||||
|                 $title = limitStringLength((string)$group->title); | ||||
|             } | ||||
|             if ('opening balance' === $type) { | ||||
|                 // TODO link to account | ||||
| @@ -1192,7 +1207,7 @@ try { | ||||
|         'transactions.bulk.edit', | ||||
|         static function (Generator $breadcrumbs, array $journals): void { | ||||
|             if (0 !== count($journals)) { | ||||
|                 $ids   = Arr::pluck($journals, 'transaction_journal_id'); | ||||
|                 $ids = Arr::pluck($journals, 'transaction_journal_id'); | ||||
|                 $first = reset($journals); | ||||
|                 $breadcrumbs->parent('transactions.index', strtolower($first['transaction_type_type'])); | ||||
|                 $breadcrumbs->push(trans('firefly.mass_bulk_journals'), route('transactions.bulk.edit', $ids)); | ||||
|   | ||||
| @@ -36,6 +36,6 @@ declare(strict_types=1); | ||||
| Broadcast::channel( | ||||
|     'App.User.{id}', | ||||
|     static function ($user, $id) { | ||||
|         return (int) $user->id === (int) $id; | ||||
|         return (int)$user->id === (int)$id; | ||||
|     } | ||||
| ); | ||||
|   | ||||
							
								
								
									
										379
									
								
								routes/web.php
									
									
									
									
									
								
							
							
						
						
									
										379
									
								
								routes/web.php
									
									
									
									
									
								
							| @@ -21,13 +21,16 @@ | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| if(!defined('DATEFORMAT')) { | ||||
| if (!defined('DATEFORMAT')) { | ||||
|     define('DATEFORMAT', '(19|20)[0-9]{2}-[0-9]{2}-[0-9]{2}'); | ||||
| } | ||||
|  | ||||
| Route::group( | ||||
|     ['namespace' => 'FireflyIII\Http\Controllers\System', | ||||
|      'as'        => 'installer.', 'prefix' => 'install',], | ||||
|     [ | ||||
|         'namespace' => 'FireflyIII\Http\Controllers\System', | ||||
|         'as'        => 'installer.', | ||||
|         'prefix'    => 'install', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'InstallController@index', 'as' => 'index']); | ||||
|         Route::post('runCommand', ['uses' => 'InstallController@runCommand', 'as' => 'runCommand']); | ||||
| @@ -158,32 +161,27 @@ Route::group( | ||||
|         // show | ||||
|         Route::get('show/{account}/all', ['uses' => 'Account\ShowController@showAll', 'as' => 'show.all']); | ||||
|         Route::get('show/{account}/{start_date?}/{end_date?}', ['uses' => 'Account\ShowController@show', 'as' => 'show']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         // reconcile routes: | ||||
|         Route::get('reconcile/{account}/index/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@reconcile', 'as' => 'reconcile']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::post('reconcile/{account}/submit/{start_date?}/{end_date?}', ['uses' => 'Account\ReconcileController@submit', 'as' => 'reconcile.submit']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         // reconcile JSON routes | ||||
|         Route::get('reconcile/{account}/overview/{start_date?}/{end_date?}', ['uses' => 'Json\ReconcileController@overview', 'as' => 'reconcile.overview']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get( | ||||
|             'reconcile/{account}/transactions/{start_date?}/{end_date?}', | ||||
|             ['uses' => 'Json\ReconcileController@transactions', 'as' => 'reconcile.transactions'] | ||||
|         ) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
|  | ||||
| @@ -266,18 +264,16 @@ Route::group( | ||||
|         Route::get('show/{budget}/{budgetLimit}', ['uses' => 'Budget\ShowController@showByBudgetLimit', 'as' => 'show.limit']); | ||||
|         Route::get('list/no-budget/all', ['uses' => 'Budget\ShowController@noBudgetAll', 'as' => 'no-budget-all']); | ||||
|         Route::get('list/no-budget/{start_date?}/{end_date?}', ['uses' => 'Budget\ShowController@noBudget', 'as' => 'no-budget']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         // reorder budgets | ||||
|         Route::post('reorder', ['uses' => 'Budget\IndexController@reorder', 'as' => 'reorder']); | ||||
|  | ||||
|         // index | ||||
|         Route::get('{start_date?}/{end_date?}', ['uses' => 'Budget\IndexController@index', 'as' => 'index']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
|  | ||||
| @@ -288,9 +284,8 @@ Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'budget-limits', 'as' => 'budget-limits.'], | ||||
|     static function () { | ||||
|         Route::get('create/{budget}/{start_date}/{end_date}', ['uses' => 'Budget\BudgetLimitController@create', 'as' => 'create']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::post('store', ['uses' => 'Budget\BudgetLimitController@store', 'as' => 'store']); | ||||
|  | ||||
|         Route::post('delete/{budgetLimit}', ['uses' => 'Budget\BudgetLimitController@delete', 'as' => 'delete']); | ||||
| @@ -323,16 +318,14 @@ Route::group( | ||||
|         // show category: | ||||
|         Route::get('show/{category}/all', ['uses' => 'Category\ShowController@showAll', 'as' => 'show.all']); | ||||
|         Route::get('show/{category}/{start_date?}/{end_date?}', ['uses' => 'Category\ShowController@show', 'as' => 'show']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         // no category controller: | ||||
|         Route::get('list/no-category/all', ['uses' => 'Category\NoCategoryController@showAll', 'as' => 'no-category.all']); | ||||
|         Route::get('list/no-category/{start_date?}/{end_date?}', ['uses' => 'Category\NoCategoryController@show', 'as' => 'no-category']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
|  | ||||
| @@ -366,30 +359,25 @@ Route::group( | ||||
|         Route::get('expense', ['uses' => 'AccountController@expenseAccounts', 'as' => 'expense']); | ||||
|         Route::get('revenue', ['uses' => 'AccountController@revenueAccounts', 'as' => 'revenue']); | ||||
|         Route::get('report/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@report', 'as' => 'report']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('period/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@period', 'as' => 'period']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('income-category/{account}/all/all', ['uses' => 'AccountController@incomeCategoryAll', 'as' => 'income-category-all']); | ||||
|         Route::get('expense-category/{account}/all/all', ['uses' => 'AccountController@expenseCategoryAll', 'as' => 'expense-category-all']); | ||||
|         Route::get('expense-budget/{account}/all/all', ['uses' => 'AccountController@expenseBudgetAll', 'as' => 'expense-budget-all']); | ||||
|  | ||||
|         Route::get('income-category/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@incomeCategory', 'as' => 'income-category']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('expense-category/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@expenseCategory', 'as' => 'expense-category']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('expense-budget/{account}/{start_date}/{end_date}', ['uses' => 'AccountController@expenseBudget', 'as' => 'expense-budget']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
|  | ||||
| @@ -412,13 +400,11 @@ Route::group( | ||||
|     static function () { | ||||
|         Route::get('frontpage', ['uses' => 'BudgetController@frontpage', 'as' => 'frontpage']); | ||||
|         Route::get('period/0/{currency}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@periodNoBudget', 'as' => 'period.no-budget']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('period/{budget}/{currency}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period', 'as' => 'period']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('budget/{budget}/{budgetLimit}', ['uses' => 'BudgetController@budgetLimit', 'as' => 'budget-limit']); | ||||
|         Route::get('budget/{budget}', ['uses' => 'BudgetController@budget', 'as' => 'budget']); | ||||
|  | ||||
| @@ -432,9 +418,8 @@ Route::group( | ||||
|             'category/expense/{accountList}/{budgetList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'BudgetReportController@categoryExpense', 'as' => 'category-expense'] | ||||
|         ) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get( | ||||
|             'budget/expense/{accountList}/{budgetList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'BudgetReportController@budgetExpense', 'as' => 'budget-expense'] | ||||
| @@ -469,7 +454,9 @@ Route::group( | ||||
|             ['uses' => 'CategoryController@reportPeriodNoCategory', 'as' => 'period.no-category'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('report-period/{category}/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriod', 'as' => 'period'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('report-period/{category}/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@reportPeriod', 'as' => 'period'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get( | ||||
| @@ -507,7 +494,9 @@ Route::group( | ||||
|             ['uses' => 'CategoryReportController@destinationIncome', 'as' => 'dest-income'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('operations/{accountList}/{category}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@mainChart', 'as' => 'main'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{category}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@mainChart', 'as' => 'main'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -519,30 +508,51 @@ Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/tag', 'as' => 'chart.tag.'], | ||||
|     static function () { | ||||
|         Route::get('tag/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagExpense', 'as' => 'tag-expense']) | ||||
|             ->where(['start_date' => DATEFORMAT]) | ||||
|             ->where(['end_date' => DATEFORMAT]) | ||||
|         ; | ||||
|         Route::get('tag/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagIncome', 'as' => 'tag-income'])->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('tag/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagIncome', 'as' => 'tag-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get( | ||||
|             'category/expense/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@categoryExpense', 'as' => 'category-expense'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('category/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@categoryIncome', 'as' => 'category-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'category/income/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@categoryIncome', 'as' => 'category-income'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('budget/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@budgetExpense', 'as' => 'budget-expense'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'budget/expense/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@budgetExpense', 'as' => 'budget-expense'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('source/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@sourceExpense', 'as' => 'source-expense'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'source/expense/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@sourceExpense', 'as' => 'source-expense'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('source/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@sourceIncome', 'as' => 'source-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'source/income/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@sourceIncome', 'as' => 'source-income'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('dest/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@destinationExpense', 'as' => 'dest-expense'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'dest/expense/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@destinationExpense', 'as' => 'dest-expense'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('dest/income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@destinationIncome', 'as' => 'dest-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'dest/income/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagReportController@destinationIncome', 'as' => 'dest-income'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('operations/{accountList}/{tag}/{start_date}/{end_date}', ['uses' => 'TagReportController@mainChart', 'as' => 'main'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{tag}/{start_date}/{end_date}', ['uses' => 'TagReportController@mainChart', 'as' => 'main'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -553,7 +563,9 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/double', 'as' => 'chart.double.'], | ||||
|     static function () { | ||||
|         Route::get('main/{accountList}/{account}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@mainChart', 'as' => 'main'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('main/{accountList}/{account}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@mainChart', 'as' => 'main'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get( | ||||
| @@ -572,9 +584,15 @@ Route::group( | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('tag/expense/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@tagExpense', 'as' => 'tag-expense'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'tag/expense/{accountList}/{doubleList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'DoubleReportController@tagExpense', 'as' => 'tag-expense'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('tag/income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@tagIncome', 'as' => 'tag-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'tag/income/{accountList}/{doubleList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'DoubleReportController@tagIncome', 'as' => 'tag-income'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -595,9 +613,13 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/report', 'as' => 'chart.report.'], | ||||
|     static function () { | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@operations', 'as' => 'operations'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@operations', 'as' => 'operations'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('net-worth/{accountList}/{start_date}/{end_date}/', ['uses' => 'ReportController@netWorth', 'as' => 'net-worth'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('net-worth/{accountList}/{start_date}/{end_date}/', ['uses' => 'ReportController@netWorth', 'as' => 'net-worth'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -608,7 +630,9 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/transactions', 'as' => 'chart.transactions.'], | ||||
|     static function () { | ||||
|         Route::get('categories/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@categories', 'as' => 'categories'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('categories/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@categories', 'as' => 'categories'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('budgets/{start_date}/{end_date}', ['uses' => 'TransactionController@budgets', 'as' => 'budgets'])->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
| @@ -617,7 +641,9 @@ Route::group( | ||||
|             ['uses' => 'TransactionController@destinationAccounts', 'as' => 'destinationAccounts'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('sourceAccounts/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@sourceAccounts', 'as' => 'sourceAccounts'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('sourceAccounts/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@sourceAccounts', 'as' => 'sourceAccounts'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         // | ||||
|     } | ||||
| @@ -819,17 +845,30 @@ Route::group( | ||||
|     static function () { | ||||
|         Route::get('', ['uses' => 'ReportController@index', 'as' => 'index']); | ||||
|         Route::get('options/{reportType}', ['uses' => 'ReportController@options', 'as' => 'options']); | ||||
|         Route::get('default/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@defaultReport', 'as' => 'report.default'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('default/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@defaultReport', 'as' => 'report.default'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('audit/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@auditReport', 'as' => 'report.audit'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('audit/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@auditReport', 'as' => 'report.audit'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('category/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'ReportController@categoryReport', 'as' => 'report.category'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'category/{accountList}/{categoryList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'ReportController@categoryReport', 'as' => 'report.category'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('budget/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'ReportController@budgetReport', 'as' => 'report.budget'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('budget/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'ReportController@budgetReport', 'as' => 'report.budget'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('tag/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'ReportController@tagReport', 'as' => 'report.tag'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('tag/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'ReportController@tagReport', 'as' => 'report.tag'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('double/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'ReportController@doubleReport', 'as' => 'report.double'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('double/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'ReportController@doubleReport', 'as' => 'report.double'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::post('', ['uses' => 'ReportController@postIndex', 'as' => 'index.post']); | ||||
| @@ -842,7 +881,9 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/account', 'as' => 'report-data.account.'], | ||||
|     static function () { | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@general', 'as' => 'general'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@general', 'as' => 'general'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -853,7 +894,9 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/bill', 'as' => 'report-data.bills.'], | ||||
|     static function () { | ||||
|         Route::get('overview/{accountList}/{start_date}/{end_date}', ['uses' => 'BillController@overview', 'as' => 'overview'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('overview/{accountList}/{start_date}/{end_date}', ['uses' => 'BillController@overview', 'as' => 'overview'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -865,19 +908,34 @@ Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/double', 'as' => 'report-data.double.'], | ||||
|     static function () { | ||||
|         // spent + earned per combination. | ||||
|         Route::get('operations/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operations', 'as' => 'operations'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operations', 'as' => 'operations'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('ops-asset/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operationsPerAsset', 'as' => 'ops-asset'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'ops-asset/{accountList}/{doubleList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'DoubleController@operationsPerAsset', 'as' => 'ops-asset'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@topExpenses', 'as' => 'top-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'top-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'DoubleController@topExpenses', 'as' => 'top-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@avgExpenses', 'as' => 'avg-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'avg-expenses/{accountList}/{doubleList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'DoubleController@avgExpenses', 'as' => 'avg-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@topIncome', 'as' => 'top-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('top-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@topIncome', 'as' => 'top-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@avgIncome', 'as' => 'avg-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('avg-income/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@avgIncome', 'as' => 'avg-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -886,14 +944,24 @@ Route::group( | ||||
|  * Report Data Income/Expenses Controller (called financial operations). | ||||
|  */ | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/operations', | ||||
|      'as'         => 'report-data.operations.',], | ||||
|     [ | ||||
|         'middleware' => 'user-full-auth', | ||||
|         'namespace'  => 'FireflyIII\Http\Controllers\Report', | ||||
|         'prefix'     => 'report-data/operations', | ||||
|         'as'         => 'report-data.operations.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@operations', 'as' => 'operations'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@operations', 'as' => 'operations'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@income', 'as' => 'income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@income', 'as' => 'income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@expenses', 'as' => 'expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@expenses', 'as' => 'expenses'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -902,20 +970,34 @@ Route::group( | ||||
|  * Report Data Category Controller. | ||||
|  */ | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/category', | ||||
|      'as'         => 'report-data.category.',], | ||||
|     [ | ||||
|         'middleware' => 'user-full-auth', | ||||
|         'namespace'  => 'FireflyIII\Http\Controllers\Report', | ||||
|         'prefix'     => 'report-data/category', | ||||
|         'as'         => 'report-data.category.', | ||||
|     ], | ||||
|     static function () { | ||||
|         // TODO three routes still in use? | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('accounts/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@accounts', 'as' => 'accounts'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('accounts/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@accounts', 'as' => 'accounts'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('categories/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@categories', 'as' => 'categories'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('categories/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@categories', 'as' => 'categories'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get( | ||||
|             'account-per-category/{accountList}/{categoryList}/{start_date}/{end_date}', | ||||
| @@ -923,14 +1005,24 @@ Route::group( | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@topExpenses', 'as' => 'top-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'top-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'CategoryController@topExpenses', 'as' => 'top-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@avgExpenses', 'as' => 'avg-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'avg-expenses/{accountList}/{categoryList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'CategoryController@avgExpenses', 'as' => 'avg-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@topIncome', 'as' => 'top-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('top-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@topIncome', 'as' => 'top-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@avgIncome', 'as' => 'avg-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('avg-income/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@avgIncome', 'as' => 'avg-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -939,24 +1031,43 @@ Route::group( | ||||
|  * Report Data TAG Controller. | ||||
|  */ | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/tag', | ||||
|      'as'         => 'report-data.tag.',], | ||||
|     [ | ||||
|         'middleware' => 'user-full-auth', | ||||
|         'namespace'  => 'FireflyIII\Http\Controllers\Report', | ||||
|         'prefix'     => 'report-data/tag', | ||||
|         'as'         => 'report-data.tag.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('accounts/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accounts', 'as' => 'accounts'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('accounts/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accounts', 'as' => 'accounts'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('tags/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@tags', 'as' => 'tags'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('tags/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@tags', 'as' => 'tags'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('account-per-tag/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accountPerTag', 'as' => 'account-per-tag'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'account-per-tag/{accountList}/{tagList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'TagController@accountPerTag', 'as' => 'account-per-tag'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topExpenses', 'as' => 'top-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('top-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topExpenses', 'as' => 'top-expenses'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgExpenses', 'as' => 'avg-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('avg-expenses/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgExpenses', 'as' => 'avg-expenses'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('top-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topIncome', 'as' => 'top-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('top-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@topIncome', 'as' => 'top-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgIncome', 'as' => 'avg-income'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('avg-income/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@avgIncome', 'as' => 'avg-income'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -967,7 +1078,9 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/balance', 'as' => 'report-data.balance.'], | ||||
|     static function () { | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'BalanceController@general', 'as' => 'general'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'BalanceController@general', 'as' => 'general'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -978,24 +1091,36 @@ Route::group( | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Report', 'prefix' => 'report-data/budget', 'as' => 'report-data.budget.'], | ||||
|     static function () { | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}/', ['uses' => 'BudgetController@general', 'as' => 'general'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('general/{accountList}/{start_date}/{end_date}/', ['uses' => 'BudgetController@general', 'as' => 'general'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         // TODO is route still used? | ||||
|         Route::get('period/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period', 'as' => 'period'])->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         Route::get('accounts/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@accounts', 'as' => 'accounts'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('accounts/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@accounts', 'as' => 'accounts'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('budgets/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@budgets', 'as' => 'budgets'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get('budgets/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@budgets', 'as' => 'budgets'])->where( | ||||
|             ['start_date' => DATEFORMAT] | ||||
|         ) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get( | ||||
|             'account-per-budget/{accountList}/{budgetList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'BudgetController@accountPerBudget', 'as' => 'account-per-budget'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('top-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@topExpenses', 'as' => 'top-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'top-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'BudgetController@topExpenses', 'as' => 'top-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|         Route::get('avg-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@avgExpenses', 'as' => 'avg-expenses'])->where(['start_date' => DATEFORMAT]) | ||||
|         Route::get( | ||||
|             'avg-expenses/{accountList}/{budgetList}/{start_date}/{end_date}', | ||||
|             ['uses' => 'BudgetController@avgExpenses', 'as' => 'avg-expenses'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|     } | ||||
| ); | ||||
| @@ -1104,7 +1229,7 @@ Route::group( | ||||
|         Route::get('{what}/{start_date?}/{end_date?}', ['uses' => 'Transaction\IndexController@index', 'as' => 'index'])->where( | ||||
|             ['what' => 'withdrawal|deposit|transfers|transfer'] | ||||
|         )->where(['start_date' => DATEFORMAT]) | ||||
|                                                                                                                         ->where(['end_date' => DATEFORMAT]); | ||||
|              ->where(['end_date' => DATEFORMAT]); | ||||
|  | ||||
|         // create group: | ||||
|         Route::get('create/{objectType}', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']); | ||||
| @@ -1154,8 +1279,12 @@ Route::group( | ||||
|  * Transaction Convert Controller. | ||||
|  */ | ||||
| Route::group( | ||||
|     ['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Transaction', 'prefix' => 'transactions/convert', | ||||
|      'as'         => 'transactions.convert.',], | ||||
|     [ | ||||
|         'middleware' => 'user-full-auth', | ||||
|         'namespace'  => 'FireflyIII\Http\Controllers\Transaction', | ||||
|         'prefix'     => 'transactions/convert', | ||||
|         'as'         => 'transactions.convert.', | ||||
|     ], | ||||
|     static function () { | ||||
|         Route::get('{transactionType}/{transactionGroup}', ['uses' => 'ConvertController@index', 'as' => 'index']); | ||||
|         Route::post('{transactionType}/{transactionGroup}', ['uses' => 'ConvertController@postIndex', 'as' => 'index.post']); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user