Add custom routes for Laravel passport.

This commit is contained in:
James Cole
2024-06-15 09:15:48 +02:00
parent 4c6fe0c8de
commit 661f225fe7
3 changed files with 151 additions and 207 deletions

View File

@@ -28,6 +28,7 @@ use Illuminate\Support\Facades\Response;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use Laravel\Passport\Passport;
/**
* Class AppServiceProvider
@@ -87,6 +88,7 @@ class AppServiceProvider extends ServiceProvider
*/
public function register(): void
{
Passport::ignoreRoutes();
// Passport::ignoreMigrations();
// Sanctum::ignoreMigrations();
}

View File

@@ -615,7 +615,9 @@ Route::group(
Route::delete('{recurrence}', ['uses' => 'DestroyController@destroy', 'as' => 'delete']);
Route::get('{recurrence}/transactions', ['uses' => 'ListController@transactions', 'as' => 'transactions']);
Route::post('trigger', ['uses' => 'RecurrenceController@trigger', 'as' => 'trigger']);
// controller does not exist:
//Route::post('trigger', ['uses' => 'RecurrenceController@trigger', 'as' => 'trigger']);
}
);

View File

@@ -25,6 +25,38 @@ if (!defined('DATEFORMAT')) {
define('DATEFORMAT', '(19|20)[0-9]{2}-?[0-9]{2}-?[0-9]{2}');
}
// laravel passport routes
Route::group([
'as' => 'passport.',
'prefix' => config('passport.path', 'oauth'),
'namespace' => '\Laravel\Passport\Http\Controllers',
], function () {
// routes with no extra middleware
Route::post('/token', ['uses' => 'AccessTokenController@issueToken', 'as' => 'token', 'middleware' => 'throttle',]);
Route::get('/authorize', ['uses' => 'AuthorizationController@authorize', 'as' => 'authorizations.authorize', 'middleware' => 'user-full-auth',]);
// the rest
$guard = config('passport.guard', null);
Route::middleware(['web', $guard ? 'auth:'.$guard : 'auth'])->group(function () {
Route::post('/token/refresh', ['uses' => 'TransientTokenController@refresh', 'as' => 'token.refresh',]);
Route::post('/authorize', ['uses' => 'ApproveAuthorizationController@approve', 'as' => 'authorizations.approve',]);
Route::delete('/authorize', ['uses' => 'DenyAuthorizationController@deny', 'as' => 'authorizations.deny',]);
Route::get('/tokens', ['uses' => 'AuthorizedAccessTokenController@forUser', 'as' => 'tokens.index',]);
Route::delete('/tokens/{token_id}', ['uses' => 'AuthorizedAccessTokenController@destroy', 'as' => 'tokens.destroy',]);
Route::get('/clients', ['uses' => 'ClientController@forUser', 'as' => 'clients.index',]);
Route::post('/clients', ['uses' => 'ClientController@store', 'as' => 'clients.store',]);
Route::put('/clients/{client_id}', ['uses' => 'ClientController@update', 'as' => 'clients.update',]);
Route::delete('/clients/{client_id}', ['uses' => 'ClientController@destroy', 'as' => 'clients.destroy',]);
Route::get('/scopes', ['uses' => 'ScopeController@all', 'as' => 'scopes.index',]);
Route::get('/personal-access-tokens', ['uses' => 'PersonalAccessTokenController@forUser', 'as' => 'personal.tokens.index',]);
Route::post('/personal-access-tokens', ['uses' => 'PersonalAccessTokenController@store', 'as' => 'personal.tokens.store',]);
Route::delete('/personal-access-tokens/{token_id}', ['uses' => 'PersonalAccessTokenController@destroy', 'as' => 'personal.tokens.destroy',]);
});
}
);
Route::group(
[
'namespace' => 'FireflyIII\Http\Controllers\System',
@@ -47,7 +79,7 @@ Route::group(
Route::group(
['middleware' => 'binders-only', 'namespace' => 'FireflyIII\Http\Controllers\System'],
static function (): void {
Route::get('offline', static fn () => view('errors.offline'));
Route::get('offline', static fn() => view('errors.offline'));
Route::get('health', ['uses' => 'HealthcheckController@check', 'as' => 'healthcheck']);
}
);
@@ -150,32 +182,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]);
}
);
@@ -252,18 +279,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]);
}
);
@@ -272,9 +297,8 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers', 'prefix' => 'budget-limits', 'as' => 'budget-limits.'],
static function (): void {
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']);
@@ -305,16 +329,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]);
}
);
@@ -341,30 +363,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]);
}
);
@@ -383,13 +400,11 @@ Route::group(
static function (): void {
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']);
@@ -403,27 +418,23 @@ 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']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'source-account/expense/{accountList}/{budgetList}/{start_date}/{end_date}',
['uses' => 'BudgetReportController@sourceAccountExpense', 'as' => 'source-account-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'destination-account/expense/{accountList}/{budgetList}/{start_date}/{end_date}',
['uses' => 'BudgetReportController@destinationAccountExpense', 'as' => 'destination-account-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('operations/{accountList}/{budget}/{start_date}/{end_date}', ['uses' => 'BudgetReportController@mainChart', 'as' => 'main']);
}
);
@@ -440,61 +451,51 @@ Route::group(
'report-period/0/{accountList}/{start_date}/{end_date}',
['uses' => 'CategoryController@reportPeriodNoCategory', 'as' => 'period.no-category']
)->where(['start_date' => DATEFORMAT])
->where(['end_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]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'category/expense/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@categoryExpense', 'as' => 'category-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'category/income/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@categoryIncome', 'as' => 'category-income']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'budget/expense/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@budgetExpense', 'as' => 'budget-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'source/expense/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@sourceExpense', 'as' => 'source-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'source/income/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@sourceIncome', 'as' => 'source-income']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'dest/expense/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@destinationExpense', 'as' => 'dest-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'dest/income/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryReportController@destinationIncome', 'as' => 'dest-income']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('operations/{accountList}/{category}/{start_date}/{end_date}', ['uses' => 'CategoryReportController@mainChart', 'as' => 'main'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -503,62 +504,52 @@ Route::group(
['middleware' => 'user-full-auth', 'namespace' => 'FireflyIII\Http\Controllers\Chart', 'prefix' => 'chart/tag', 'as' => 'chart.tag.'],
static function (): void {
Route::get('tag/expense/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagReportController@tagExpense', 'as' => 'tag-expense'])
->where(['start_date' => DATEFORMAT])
->where(['end_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])
;
->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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_date' => DATEFORMAT]);
Route::get('operations/{accountList}/{tag}/{start_date}/{end_date}', ['uses' => 'TagReportController@mainChart', 'as' => 'main'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -569,40 +560,34 @@ Route::group(
Route::get('main/{accountList}/{account}/{start_date}/{end_date}', ['uses' => 'DoubleReportController@mainChart', 'as' => 'main'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'category/expense/{accountList}/{doubleList}/{start_date}/{end_date}',
['uses' => 'DoubleReportController@categoryExpense', 'as' => 'category-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'category/income/{accountList}/{doubleList}/{start_date}/{end_date}',
['uses' => 'DoubleReportController@categoryIncome', 'as' => 'category-income']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'budget/expense/{accountList}/{doubleList}/{start_date}/{end_date}',
['uses' => 'DoubleReportController@budgetExpense', 'as' => 'budget-expense']
)->where(['start_date' => DATEFORMAT])
->where(['end_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])
->where(['end_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])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -621,13 +606,11 @@ Route::group(
Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@operations', 'as' => 'operations'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -638,22 +621,18 @@ Route::group(
Route::get('categories/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@categories', 'as' => 'categories'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'destinationAccounts/{objectType}/{start_date}/{end_date}',
['uses' => 'TransactionController@destinationAccounts', 'as' => 'destinationAccounts']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('sourceAccounts/{objectType}/{start_date}/{end_date}', ['uses' => 'TransactionController@sourceAccounts', 'as' => 'sourceAccounts'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -711,8 +690,7 @@ Route::group(
'budget/total-budgeted/{currency}/{start_date}/{end_date}',
['uses' => 'Json\BudgetController@getBudgetInformation', 'as' => 'budget.total-budgeted']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
// boxes
Route::get('box/balance', ['uses' => 'Json\BoxController@balance', 'as' => 'box.balance']);
Route::get('box/available', ['uses' => 'Json\BoxController@available', 'as' => 'box.available']);
@@ -726,7 +704,7 @@ Route::group(
Route::get('frontpage/piggy-banks', ['uses' => 'Json\FrontpageController@piggyBanks', 'as' => 'fp.piggy-banks']);
// currency conversion:
Route::get('rate/{fromCurrencyCode}/{toCurrencyCode}/{date}', ['uses' => 'Json\ExchangeController@getRate', 'as' => 'rate']);
//Route::get('rate/{fromCurrencyCode}/{toCurrencyCode}/{date}', ['uses' => 'Json\ExchangeController@getRate', 'as' => 'rate']);
// intro things:
Route::post('intro/finished/{route}/{specificPage?}', ['uses' => 'Json\IntroController@postFinished', 'as' => 'intro.finished']);
@@ -852,8 +830,7 @@ Route::group(
Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@general', 'as' => 'general'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -864,8 +841,7 @@ Route::group(
Route::get('overview/{accountList}/{start_date}/{end_date}', ['uses' => 'BillController@overview', 'as' => 'overview'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -877,38 +853,32 @@ Route::group(
Route::get('operations/{accountList}/{doubleList}/{start_date}/{end_date}', ['uses' => 'DoubleController@operations', 'as' => 'operations'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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])
->where(['end_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])
->where(['end_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])
->where(['end_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]
)
->where(['end_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]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -924,18 +894,15 @@ Route::group(
Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@operations', 'as' => 'operations'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@income', 'as' => 'income'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@expenses', 'as' => 'expenses'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -952,59 +919,49 @@ Route::group(
Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('accounts/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@accounts', 'as' => 'accounts'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('categories/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'CategoryController@categories', 'as' => 'categories'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get(
'account-per-category/{accountList}/{categoryList}/{start_date}/{end_date}',
['uses' => 'CategoryController@accountPerCategory', 'as' => 'account-per-category']
)->where(['start_date' => DATEFORMAT])
->where(['end_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])
->where(['end_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])
->where(['end_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]
)
->where(['end_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]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -1020,41 +977,34 @@ Route::group(
Route::get('accounts/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@accounts', 'as' => 'accounts'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('tags/{accountList}/{tagList}/{start_date}/{end_date}', ['uses' => 'TagController@tags', 'as' => 'tags'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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])
->where(['end_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]
)
->where(['end_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]
)
->where(['end_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]
)
->where(['end_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]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -1065,8 +1015,7 @@ Route::group(
Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'BalanceController@general', 'as' => 'general'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -1077,41 +1026,34 @@ Route::group(
Route::get('general/{accountList}/{start_date}/{end_date}/', ['uses' => 'BudgetController@general', 'as' => 'general'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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])
;
->where(['end_date' => DATEFORMAT]);
Route::get('accounts/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@accounts', 'as' => 'accounts'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('budgets/{accountList}/{budgetList}/{start_date}/{end_date}', ['uses' => 'BudgetController@budgets', 'as' => 'budgets'])->where(
['start_date' => DATEFORMAT]
)
->where(['end_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])
;
->where(['end_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])
;
->where(['end_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])
;
->where(['end_date' => DATEFORMAT]);
}
);
@@ -1184,8 +1126,7 @@ Route::group(
Route::get('show/{tagOrId}/all', ['uses' => 'TagController@showAll', 'as' => 'show.all']);
Route::get('show/{tagOrId}/{start_date?}/{end_date?}', ['uses' => 'TagController@show', 'as' => 'show'])->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
Route::get('edit/{tag}', ['uses' => 'TagController@edit', 'as' => 'edit']);
Route::get('delete/{tag}', ['uses' => 'TagController@delete', 'as' => 'delete']);
@@ -1210,8 +1151,7 @@ Route::group(
Route::get('{objectType}/{start_date?}/{end_date?}', ['uses' => 'Transaction\IndexController@index', 'as' => 'index'])->where(
['objectType' => 'withdrawal|deposit|transfers|transfer|all']
)->where(['start_date' => DATEFORMAT])
->where(['end_date' => DATEFORMAT])
;
->where(['end_date' => DATEFORMAT]);
// create group:
Route::get('create/{objectType}', ['uses' => 'Transaction\CreateController@create', 'as' => 'create']);
@@ -1355,7 +1295,7 @@ Route::group(
Route::get('', ['uses' => 'UserGroup\IndexController@index', 'as' => 'index']);
Route::get('create', ['uses' => 'UserGroup\CreateController@create', 'as' => 'create']);
Route::get('edit/{userGroup}', ['uses' => 'UserGroup\EditController@edit', 'as' => 'edit']);
Route::get('show/{userGroup}', ['uses' => 'UserGroup\ShowController@show', 'as' => 'show']);
//Route::get('show/{userGroup}', ['uses' => 'UserGroup\ShowController@show', 'as' => 'show']);
// Route::post('rescan/{bill}', ['uses' => 'Bill\ShowController@rescan', 'as' => 'rescan']);
// Route::get('delete/{bill}', ['uses' => 'Bill\DeleteController@delete', 'as' => 'delete']);