firefly-iii/app/Http/routes.php

547 lines
24 KiB
PHP
Raw Normal View History

2015-02-05 21:39:52 -06:00
<?php
2015-12-12 10:51:07 -06:00
use Carbon\Carbon;
use FireflyIII\Models\Account;
2015-07-18 14:32:31 -05:00
use FireflyIII\Models\Attachment;
2015-02-22 02:46:21 -06:00
use FireflyIII\Models\Bill;
2015-02-22 09:19:32 -06:00
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
2015-02-22 08:40:13 -06:00
use FireflyIII\Models\LimitRepetition;
2015-03-10 11:26:31 -05:00
use FireflyIII\Models\PiggyBank;
2015-04-28 04:04:38 -05:00
use FireflyIII\Models\Tag;
2015-02-25 08:57:43 -06:00
use FireflyIII\Models\TransactionCurrency;
2015-02-25 14:19:06 -06:00
use FireflyIII\Models\TransactionJournal;
2015-04-28 04:04:38 -05:00
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
2015-02-22 08:40:13 -06:00
// models
Route::bind(
'account',
2015-06-06 16:09:12 -05:00
function ($value) {
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
2015-06-06 16:09:12 -05:00
->where('account_types.editable', 1)
->where('accounts.id', $value)
->where('user_id', Auth::user()->id)
->first(['accounts.*']);
2015-04-28 04:04:38 -05:00
if ($object) {
return $object;
}
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
}
);
2015-12-28 00:49:27 -06:00
// accounts
2015-12-12 10:51:07 -06:00
Route::bind(
'accountList',
function ($value) {
if (Auth::check()) {
2015-12-15 05:38:18 -06:00
$ids = explode(',', $value);
2015-12-12 10:51:07 -06:00
/** @var \Illuminate\Support\Collection $object */
$object = Account::leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
->where('account_types.editable', 1)
->whereIn('accounts.id', $ids)
->where('user_id', Auth::user()->id)
->get(['accounts.*']);
if ($object->count() > 0) {
return $object;
}
}
throw new NotFoundHttpException;
}
);
2015-12-15 05:38:18 -06:00
// budget list
Route::bind(
'budgetList',
function ($value) {
if (Auth::check()) {
$ids = explode(',', $value);
/** @var \Illuminate\Support\Collection $object */
$object = Budget::where('active', 1)
->whereIn('id', $ids)
->where('user_id', Auth::user()->id)
->get();
// add empty budget if applicable.
if (in_array('0', $ids)) {
$object->push(new Budget);
}
2015-12-15 05:38:18 -06:00
if ($object->count() > 0) {
return $object;
}
}
throw new NotFoundHttpException;
}
);
2015-12-12 10:51:07 -06:00
// category list
Route::bind(
'categoryList',
function ($value) {
if (Auth::check()) {
$ids = explode(',', $value);
/** @var \Illuminate\Support\Collection $object */
$object = Category::whereIn('id', $ids)
->where('user_id', Auth::user()->id)
->get();
// add empty budget if applicable.
if (in_array('0', $ids)) {
$object->push(new Category);
}
if ($object->count() > 0) {
return $object;
}
}
throw new NotFoundHttpException;
}
);
2015-12-12 10:51:07 -06:00
// Date
Route::bind(
'start_date',
function ($value) {
if (Auth::check()) {
try {
$date = new Carbon($value);
} catch (Exception $e) {
Log::error('Could not parse date "' . $value . '" for user #' . Auth::user()->id);
throw new NotFoundHttpException;
}
return $date;
}
throw new NotFoundHttpException;
}
);
// Date
Route::bind(
'end_date',
function ($value) {
if (Auth::check()) {
try {
$date = new Carbon($value);
} catch (Exception $e) {
Log::error('Could not parse date "' . $value . '" for user #' . Auth::user()->id);
throw new NotFoundHttpException;
}
return $date;
}
throw new NotFoundHttpException;
}
);
2015-02-25 14:19:06 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'tj', function ($value) {
2015-02-25 14:19:06 -06:00
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = TransactionJournal::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
return $object;
}
2015-02-25 14:19:06 -06:00
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
2015-02-25 14:19:06 -06:00
}
);
2015-07-18 14:32:31 -05:00
Route::bind(
'attachment', function ($value) {
if (Auth::check()) {
$object = Attachment::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
return $object;
}
}
throw new NotFoundHttpException;
}
);
2015-02-25 08:57:43 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'currency', function ($value) {
2015-04-28 04:04:38 -05:00
if (Auth::check()) {
$object = TransactionCurrency::find($value);
if ($object) {
return $object;
}
}
throw new NotFoundHttpException;
2015-02-25 08:57:43 -06:00
}
);
2015-02-22 02:46:21 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'bill', function ($value) {
2015-02-22 02:46:21 -06:00
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = Bill::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
return $object;
}
2015-02-22 02:46:21 -06:00
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
2015-02-22 02:46:21 -06:00
}
);
Route::bind(
2015-06-06 16:09:12 -05:00
'budget', function ($value) {
2015-02-22 02:46:21 -06:00
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = Budget::where('id', $value)->where('user_id', Auth::user()->id)->first();
if ($object) {
return $object;
}
2015-02-22 02:46:21 -06:00
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
2015-02-22 02:46:21 -06:00
}
);
2015-02-22 08:40:13 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'limitrepetition', function ($value) {
2015-02-22 08:40:13 -06:00
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = LimitRepetition::where('limit_repetitions.id', $value)
2015-06-06 16:09:12 -05:00
->leftjoin('budget_limits', 'budget_limits.id', '=', 'limit_repetitions.budget_limit_id')
->leftJoin('budgets', 'budgets.id', '=', 'budget_limits.budget_id')
->where('budgets.user_id', Auth::user()->id)
->first(['limit_repetitions.*']);
2015-04-28 04:04:38 -05:00
if ($object) {
return $object;
}
2015-02-22 08:40:13 -06:00
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
2015-02-22 08:40:13 -06:00
}
);
2015-02-05 21:39:52 -06:00
2015-02-25 12:32:33 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'piggyBank', function ($value) {
2015-02-25 12:32:33 -06:00
if (Auth::check()) {
2015-04-28 04:04:38 -05:00
$object = PiggyBank::where('piggy_banks.id', $value)
2015-06-06 16:09:12 -05:00
->leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')
->where('accounts.user_id', Auth::user()->id)
->first(['piggy_banks.*']);
2015-04-28 04:04:38 -05:00
if ($object) {
return $object;
}
2015-02-25 12:32:33 -06:00
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
2015-02-25 12:32:33 -06:00
}
);
2015-02-22 09:19:32 -06:00
Route::bind(
2015-06-06 16:09:12 -05:00
'category', function ($value) {
2015-02-22 09:19:32 -06:00
if (Auth::check()) {
2015-05-03 02:55:22 -05:00
$object = Category::where('id', $value)->where('user_id', Auth::user()->id)->first();
2015-04-28 04:04:38 -05:00
if ($object) {
2015-05-03 02:55:22 -05:00
return $object;
}
}
throw new NotFoundHttpException;
}
);
Route::bind(
2015-06-06 16:09:12 -05:00
'tag', function ($value) {
if (Auth::check()) {
2015-05-03 02:55:22 -05:00
$object = Tag::where('id', $value)->where('user_id', Auth::user()->id)->first();
2015-04-28 04:04:38 -05:00
if ($object) {
2015-05-03 02:55:22 -05:00
return $object;
2015-04-28 04:04:38 -05:00
}
}
2015-04-28 04:04:38 -05:00
throw new NotFoundHttpException;
}
);
2015-02-27 09:08:46 -06:00
/**
* Auth\AuthController
*/
Route::get('/register', ['uses' => 'Auth\AuthController@getRegister', 'as' => 'register']);
2015-07-22 12:09:17 -05:00
Route::get('/cron/sendgrid', ['uses' => 'CronController@sendgrid']);
2015-02-27 09:08:46 -06:00
Route::controllers(
[
2015-12-18 09:38:50 -06:00
'auth' => 'Auth\AuthController',
2015-02-27 09:08:46 -06:00
'password' => 'Auth\PasswordController',
]
);
2015-06-14 01:22:02 -05:00
2015-02-07 06:15:40 -06:00
Route::group(
2015-06-22 14:31:12 -05:00
['middleware' => ['auth', 'range']], function () {
2015-06-14 01:22:02 -05:00
/**
* Home Controller
*/
2015-06-05 02:51:52 -05:00
Route::get('/', ['uses' => 'HomeController@index', 'as' => 'index']);
2015-02-27 09:08:46 -06:00
Route::get('/home', ['uses' => 'HomeController@index', 'as' => 'home']);
2015-03-10 11:26:31 -05:00
Route::post('/daterange', ['uses' => 'HomeController@dateRange', 'as' => 'daterange']);
2015-02-07 06:15:40 -06:00
Route::get('/flush', ['uses' => 'HomeController@flush', 'as' => 'flush']);
/**
* Account Controller
*/
Route::get('/accounts/{what}', ['uses' => 'AccountController@index', 'as' => 'accounts.index'])->where('what', 'revenue|asset|expense');
Route::get('/accounts/create/{what}', ['uses' => 'AccountController@create', 'as' => 'accounts.create'])->where('what', 'revenue|asset|expense');
Route::get('/accounts/edit/{account}', ['uses' => 'AccountController@edit', 'as' => 'accounts.edit']);
Route::get('/accounts/delete/{account}', ['uses' => 'AccountController@delete', 'as' => 'accounts.delete']);
2015-02-07 06:15:40 -06:00
Route::get('/accounts/show/{account}/{view?}', ['uses' => 'AccountController@show', 'as' => 'accounts.show']);
Route::post('/accounts/store', ['uses' => 'AccountController@store', 'as' => 'accounts.store']);
Route::post('/accounts/update/{account}', ['uses' => 'AccountController@update', 'as' => 'accounts.update']);
Route::post('/accounts/destroy/{account}', ['uses' => 'AccountController@destroy', 'as' => 'accounts.destroy']);
2015-02-07 06:15:40 -06:00
2015-07-18 16:06:51 -05:00
2015-07-18 14:32:31 -05:00
/**
* Attachment Controller
*/
2015-07-18 16:06:51 -05:00
2015-07-19 05:21:38 -05:00
Route::post('/attachment/update/{attachment}', ['uses' => 'AttachmentController@update', 'as' => 'attachments.update']);
Route::post('/attachment/destroy/{attachment}', ['uses' => 'AttachmentController@destroy', 'as' => 'attachments.destroy']);
2015-07-18 16:06:51 -05:00
2015-07-19 05:21:38 -05:00
Route::get('/attachment/edit/{attachment}', ['uses' => 'AttachmentController@edit', 'as' => 'attachments.edit']);
Route::get('/attachment/delete/{attachment}', ['uses' => 'AttachmentController@delete', 'as' => 'attachments.delete']);
Route::get('/attachment/show/{attachment}', ['uses' => 'AttachmentController@show', 'as' => 'attachments.show']);
2015-07-19 15:19:36 -05:00
Route::get('/attachment/preview/{attachment}', ['uses' => 'AttachmentController@preview', 'as' => 'attachments.preview']);
2015-07-19 05:21:38 -05:00
Route::get('/attachment/download/{attachment}', ['uses' => 'AttachmentController@download', 'as' => 'attachments.download']);
2015-07-18 14:32:31 -05:00
2015-02-07 06:15:40 -06:00
/**
* Bills Controller
*/
Route::get('/bills', ['uses' => 'BillController@index', 'as' => 'bills.index']);
2015-07-06 11:13:57 -05:00
Route::get('/bills/rescan/{bill}', ['uses' => 'BillController@rescan', 'as' => 'bills.rescan']);
2015-02-07 06:15:40 -06:00
Route::get('/bills/create', ['uses' => 'BillController@create', 'as' => 'bills.create']);
2015-02-25 08:19:14 -06:00
Route::get('/bills/edit/{bill}', ['uses' => 'BillController@edit', 'as' => 'bills.edit']);
Route::get('/bills/delete/{bill}', ['uses' => 'BillController@delete', 'as' => 'bills.delete']);
2015-02-22 01:38:46 -06:00
Route::get('/bills/show/{bill}', ['uses' => 'BillController@show', 'as' => 'bills.show']);
2015-02-25 08:19:14 -06:00
Route::post('/bills/store', ['uses' => 'BillController@store', 'as' => 'bills.store']);
Route::post('/bills/update/{bill}', ['uses' => 'BillController@update', 'as' => 'bills.update']);
Route::post('/bills/destroy/{bill}', ['uses' => 'BillController@destroy', 'as' => 'bills.destroy']);
2015-02-07 06:15:40 -06:00
/**
* Budget Controller
*/
Route::get('/budgets', ['uses' => 'BudgetController@index', 'as' => 'budgets.index']);
2015-07-06 11:13:57 -05:00
Route::get('/budgets/income', ['uses' => 'BudgetController@updateIncome', 'as' => 'budgets.income']);
2015-02-22 02:46:21 -06:00
Route::get('/budgets/create', ['uses' => 'BudgetController@create', 'as' => 'budgets.create']);
Route::get('/budgets/edit/{budget}', ['uses' => 'BudgetController@edit', 'as' => 'budgets.edit']);
Route::get('/budgets/delete/{budget}', ['uses' => 'BudgetController@delete', 'as' => 'budgets.delete']);
2015-02-22 01:38:46 -06:00
Route::get('/budgets/show/{budget}/{limitrepetition?}', ['uses' => 'BudgetController@show', 'as' => 'budgets.show']);
2015-02-22 02:46:21 -06:00
Route::get('/budgets/list/noBudget', ['uses' => 'BudgetController@noBudget', 'as' => 'budgets.noBudget']);
Route::post('/budgets/income', ['uses' => 'BudgetController@postUpdateIncome', 'as' => 'budgets.postIncome']);
Route::post('/budgets/store', ['uses' => 'BudgetController@store', 'as' => 'budgets.store']);
Route::post('/budgets/update/{budget}', ['uses' => 'BudgetController@update', 'as' => 'budgets.update']);
Route::post('/budgets/destroy/{budget}', ['uses' => 'BudgetController@destroy', 'as' => 'budgets.destroy']);
Route::post('budgets/amount/{budget}', ['uses' => 'BudgetController@amount']);
2015-02-07 06:15:40 -06:00
/**
* Category Controller
*/
Route::get('/categories', ['uses' => 'CategoryController@index', 'as' => 'categories.index']);
2015-02-22 09:19:32 -06:00
Route::get('/categories/create', ['uses' => 'CategoryController@create', 'as' => 'categories.create']);
Route::get('/categories/edit/{category}', ['uses' => 'CategoryController@edit', 'as' => 'categories.edit']);
Route::get('/categories/delete/{category}', ['uses' => 'CategoryController@delete', 'as' => 'categories.delete']);
2015-02-22 01:38:46 -06:00
Route::get('/categories/show/{category}', ['uses' => 'CategoryController@show', 'as' => 'categories.show']);
2015-09-25 09:00:14 -05:00
Route::get('/categories/show/{category}/{date}', ['uses' => 'CategoryController@showWithDate', 'as' => 'categories.show.date']);
2015-02-22 09:19:32 -06:00
Route::get('/categories/list/noCategory', ['uses' => 'CategoryController@noCategory', 'as' => 'categories.noCategory']);
Route::post('/categories/store', ['uses' => 'CategoryController@store', 'as' => 'categories.store']);
Route::post('/categories/update/{category}', ['uses' => 'CategoryController@update', 'as' => 'categories.update']);
Route::post('/categories/destroy/{category}', ['uses' => 'CategoryController@destroy', 'as' => 'categories.destroy']);
2015-02-07 06:15:40 -06:00
2015-07-03 03:45:00 -05:00
/**
* CSV controller
*/
Route::get('/csv', ['uses' => 'CsvController@index', 'as' => 'csv.index']);
Route::post('/csv/upload', ['uses' => 'CsvController@upload', 'as' => 'csv.upload']);
Route::get('/csv/column_roles', ['uses' => 'CsvController@columnRoles', 'as' => 'csv.column-roles']);
Route::post('/csv/initial_parse', ['uses' => 'CsvController@initialParse', 'as' => 'csv.initial_parse']);
Route::get('/csv/map', ['uses' => 'CsvController@map', 'as' => 'csv.map']);
2015-07-04 23:18:02 -05:00
Route::get('/csv/download-config', ['uses' => 'CsvController@downloadConfig', 'as' => 'csv.download-config']);
Route::get('/csv/download', ['uses' => 'CsvController@downloadConfigPage', 'as' => 'csv.download-config-page']);
Route::post('/csv/save_mapping', ['uses' => 'CsvController@saveMapping', 'as' => 'csv.save_mapping']);
2015-07-04 23:18:02 -05:00
Route::get('/csv/process', ['uses' => 'CsvController@process', 'as' => 'csv.process']);
2015-07-03 03:45:00 -05:00
2015-02-07 06:15:40 -06:00
/**
* Currency Controller
*/
Route::get('/currency', ['uses' => 'CurrencyController@index', 'as' => 'currency.index']);
2015-02-25 08:57:43 -06:00
Route::get('/currency/create', ['uses' => 'CurrencyController@create', 'as' => 'currency.create']);
Route::get('/currency/edit/{currency}', ['uses' => 'CurrencyController@edit', 'as' => 'currency.edit']);
Route::get('/currency/delete/{currency}', ['uses' => 'CurrencyController@delete', 'as' => 'currency.delete']);
Route::get('/currency/default/{currency}', ['uses' => 'CurrencyController@defaultCurrency', 'as' => 'currency.default']);
Route::post('/currency/store', ['uses' => 'CurrencyController@store', 'as' => 'currency.store']);
Route::post('/currency/update/{currency}', ['uses' => 'CurrencyController@update', 'as' => 'currency.update']);
Route::post('/currency/destroy/{currency}', ['uses' => 'CurrencyController@destroy', 'as' => 'currency.destroy']);
2015-02-07 06:15:40 -06:00
/**
2015-05-16 02:57:31 -05:00
* ALL CHART Controllers
2015-02-07 06:15:40 -06:00
*/
2015-05-16 02:57:31 -05:00
// accounts:
Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']);
2015-08-01 00:04:41 -05:00
Route::get('/chart/account/expense', ['uses' => 'Chart\AccountController@expenseAccounts']);
2015-12-28 13:04:54 -06:00
Route::get('/chart/account/report/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\AccountController@report']);
2015-05-16 02:57:31 -05:00
Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']);
2015-05-17 11:03:16 -05:00
2015-05-16 02:57:31 -05:00
// bills:
Route::get('/chart/bill/frontpage', ['uses' => 'Chart\BillController@frontpage']);
Route::get('/chart/bill/{bill}', ['uses' => 'Chart\BillController@single']);
// budgets:
Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']);
2015-12-12 13:56:07 -06:00
// this chart is used in reports:
2015-12-28 13:04:54 -06:00
Route::get('/chart/budget/year/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\BudgetController@year']);
Route::get('/chart/budget/multi-year/{reportType}/{start_date}/{end_date}/{accountList}/{budgetList}', ['uses' => 'Chart\BudgetController@multiYear']);
2015-12-12 13:56:07 -06:00
2015-05-16 02:57:31 -05:00
Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']);
Route::get('/chart/budget/{budget}', ['uses' => 'Chart\BudgetController@budget']);
2015-05-16 02:57:31 -05:00
// categories:
Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']);
2015-12-12 13:56:07 -06:00
// these three charts are for reports:
2015-12-28 13:04:54 -06:00
Route::get('/chart/category/earned-in-period/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@earnedInPeriod']);
Route::get('/chart/category/spent-in-period/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@spentInPeriod']);
Route::get(
2015-12-28 13:04:54 -06:00
'/chart/category/multi-year/{reportType}/{start_date}/{end_date}/{accountList}/{categoryList}', ['uses' => 'Chart\CategoryController@multiYear']
);
2015-12-12 13:56:07 -06:00
Route::get('/chart/category/{category}/period', ['uses' => 'Chart\CategoryController@currentPeriod']);
Route::get('/chart/category/{category}/period/{date}', ['uses' => 'Chart\CategoryController@specificPeriod']);
2015-05-16 02:57:31 -05:00
Route::get('/chart/category/{category}/all', ['uses' => 'Chart\CategoryController@all']);
// piggy banks:
Route::get('/chart/piggy-bank/{piggyBank}', ['uses' => 'Chart\PiggyBankController@history']);
2015-05-16 02:26:54 -05:00
2015-05-16 03:05:22 -05:00
// reports:
2015-12-28 13:04:54 -06:00
Route::get('/chart/report/in-out/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOut']);
Route::get('/chart/report/in-out-sum/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOutSummarized']);
2015-05-16 02:57:31 -05:00
2015-02-25 09:10:02 -06:00
/**
* Help Controller
*/
Route::get('/help/{route}', ['uses' => 'HelpController@show', 'as' => 'help.show']);
/**
* JSON Controller
*/
2015-02-24 15:53:38 -06:00
Route::get('/json/expense-accounts', ['uses' => 'JsonController@expenseAccounts', 'as' => 'json.expense-accounts']);
Route::get('/json/revenue-accounts', ['uses' => 'JsonController@revenueAccounts', 'as' => 'json.revenue-accounts']);
Route::get('/json/categories', ['uses' => 'JsonController@categories', 'as' => 'json.categories']);
2015-04-28 03:36:13 -05:00
Route::get('/json/tags', ['uses' => 'JsonController@tags', 'as' => 'json.tags']);
2015-07-11 03:01:13 -05:00
Route::get('/json/tour', ['uses' => 'JsonController@tour', 'as' => 'json.tour']);
2015-07-12 05:45:41 -05:00
Route::post('/json/end-tour', ['uses' => 'JsonController@endTour']);
Route::get('/json/box/in', ['uses' => 'JsonController@boxIn', 'as' => 'json.box.in']);
Route::get('/json/box/out', ['uses' => 'JsonController@boxOut', 'as' => 'json.box.out']);
Route::get('/json/box/bills-unpaid', ['uses' => 'JsonController@boxBillsUnpaid', 'as' => 'json.box.paid']);
Route::get('/json/box/bills-paid', ['uses' => 'JsonController@boxBillsPaid', 'as' => 'json.box.unpaid']);
2015-03-27 07:16:14 -05:00
Route::get('/json/transaction-journals/{what}', 'JsonController@transactionJournals');
2015-02-07 06:15:40 -06:00
2015-06-01 11:13:54 -05:00
/**
* New user Controller
*/
Route::get('/new-user', ['uses' => 'NewUserController@index', 'as' => 'new-user.index']);
Route::post('/new-user/submit', ['uses' => 'NewUserController@submit', 'as' => 'new-user.submit']);
2015-02-07 06:15:40 -06:00
/**
* Piggy Bank Controller
*/
2015-02-24 14:10:25 -06:00
Route::get('/piggy-banks', ['uses' => 'PiggyBankController@index', 'as' => 'piggy-banks.index']);
2015-07-06 11:13:57 -05:00
Route::get('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@add', 'as' => 'piggy-banks.addMoney']);
Route::get('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@remove', 'as' => 'piggy-banks.removeMoney']);
2015-02-24 14:10:25 -06:00
Route::get('/piggy-banks/create', ['uses' => 'PiggyBankController@create', 'as' => 'piggy-banks.create']);
Route::get('/piggy-banks/edit/{piggyBank}', ['uses' => 'PiggyBankController@edit', 'as' => 'piggy-banks.edit']);
Route::get('/piggy-banks/delete/{piggyBank}', ['uses' => 'PiggyBankController@delete', 'as' => 'piggy-banks.delete']);
Route::get('/piggy-banks/show/{piggyBank}', ['uses' => 'PiggyBankController@show', 'as' => 'piggy-banks.show']);
2015-02-25 12:32:33 -06:00
Route::post('/piggy-banks/store', ['uses' => 'PiggyBankController@store', 'as' => 'piggy-banks.store']);
Route::post('/piggy-banks/update/{piggyBank}', ['uses' => 'PiggyBankController@update', 'as' => 'piggy-banks.update']);
Route::post('/piggy-banks/destroy/{piggyBank}', ['uses' => 'PiggyBankController@destroy', 'as' => 'piggy-banks.destroy']);
2015-07-06 11:13:57 -05:00
Route::post('/piggy-banks/add/{piggyBank}', ['uses' => 'PiggyBankController@postAdd', 'as' => 'piggy-banks.add']);
Route::post('/piggy-banks/remove/{piggyBank}', ['uses' => 'PiggyBankController@postRemove', 'as' => 'piggy-banks.remove']);
2015-03-15 12:00:33 -05:00
Route::post('/piggy-banks/sort', ['uses' => 'PiggyBankController@order', 'as' => 'piggy-banks.order']);
2015-02-07 06:15:40 -06:00
/**
* Preferences Controller
*/
Route::get('/preferences', ['uses' => 'PreferencesController@index', 'as' => 'preferences']);
2015-02-25 14:19:06 -06:00
Route::post('/preferences', ['uses' => 'PreferencesController@postIndex']);
2015-02-07 06:15:40 -06:00
/**
* Profile Controller
*/
Route::get('/profile', ['uses' => 'ProfileController@index', 'as' => 'profile']);
2015-06-21 03:50:45 -05:00
Route::get('/profile/change-password', ['uses' => 'ProfileController@changePassword', 'as' => 'profile.change-password']);
Route::get('/profile/delete-account', ['uses' => 'ProfileController@deleteAccount', 'as' => 'profile.delete-account']);
Route::post('/profile/delete-account', ['uses' => 'ProfileController@postDeleteAccount', 'as' => 'delete-account-post']);
2015-03-10 11:26:31 -05:00
Route::post('/profile/change-password', ['uses' => 'ProfileController@postChangePassword', 'as' => 'change-password-post']);
2015-02-25 14:19:06 -06:00
2015-02-07 06:15:40 -06:00
/**
* Report Controller
*/
Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']);
2015-12-28 13:04:54 -06:00
Route::get('/reports/report/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'ReportController@report', 'as' => 'reports.report']);
2015-02-07 06:15:40 -06:00
/**
* Search Controller
*/
Route::get('/search', ['uses' => 'SearchController@index', 'as' => 'search']);
/**
* Tag Controller
*/
Route::get('/tags', ['uses' => 'TagController@index', 'as' => 'tags.index']);
Route::get('/tags/create', ['uses' => 'TagController@create', 'as' => 'tags.create']);
Route::get('/tags/show/{tag}', ['uses' => 'TagController@show', 'as' => 'tags.show']);
Route::get('/tags/edit/{tag}', ['uses' => 'TagController@edit', 'as' => 'tags.edit']);
Route::get('/tags/delete/{tag}', ['uses' => 'TagController@delete', 'as' => 'tags.delete']);
Route::post('/tags/store', ['uses' => 'TagController@store', 'as' => 'tags.store']);
Route::post('/tags/update/{tag}', ['uses' => 'TagController@update', 'as' => 'tags.update']);
Route::post('/tags/destroy/{tag}', ['uses' => 'TagController@destroy', 'as' => 'tags.destroy']);
Route::post('/tags/hideTagHelp/{state}', ['uses' => 'TagController@hideTagHelp', 'as' => 'tags.hideTagHelp']);
2015-02-07 06:15:40 -06:00
/**
* Transaction Controller
*/
Route::get('/transactions/{what}', ['uses' => 'TransactionController@index', 'as' => 'transactions.index'])->where(
['what' => 'expenses|revenue|withdrawal|deposit|transfer|transfers']
);
Route::get('/transactions/create/{what}', ['uses' => 'TransactionController@create', 'as' => 'transactions.create'])->where(
['what' => 'expenses|revenue|withdrawal|deposit|transfer|transfers']
);
2015-02-22 01:38:46 -06:00
Route::get('/transaction/edit/{tj}', ['uses' => 'TransactionController@edit', 'as' => 'transactions.edit']);
Route::get('/transaction/delete/{tj}', ['uses' => 'TransactionController@delete', 'as' => 'transactions.delete']);
2015-02-07 06:15:40 -06:00
Route::get('/transaction/show/{tj}', ['uses' => 'TransactionController@show', 'as' => 'transactions.show']);
2015-02-24 14:10:25 -06:00
// transaction controller:
Route::post('/transactions/store/{what}', ['uses' => 'TransactionController@store', 'as' => 'transactions.store'])->where(
['what' => 'expenses|revenue|withdrawal|deposit|transfer|transfers']
);
Route::post('/transaction/update/{tj}', ['uses' => 'TransactionController@update', 'as' => 'transactions.update']);
Route::post('/transaction/destroy/{tj}', ['uses' => 'TransactionController@destroy', 'as' => 'transactions.destroy']);
Route::post('/transaction/reorder', ['uses' => 'TransactionController@reorder', 'as' => 'transactions.reorder']);
2015-02-07 06:15:40 -06:00
/**
2015-02-07 15:50:47 -06:00
* Auth\Auth Controller
2015-02-07 06:15:40 -06:00
*/
2015-02-07 15:50:47 -06:00
Route::get('/logout', ['uses' => 'Auth\AuthController@getLogout', 'as' => 'logout']);
2015-02-07 06:15:40 -06:00
}
2015-02-06 00:23:26 -06:00
);
2015-02-07 15:50:47 -06:00