firefly-iii/app/Http/breadcrumbs.php

613 lines
20 KiB
PHP
Raw Normal View History

2015-02-22 02:46:21 -06:00
<?php
/**
* breadcrumbs.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
2016-02-05 05:08:25 -06:00
declare(strict_types = 1);
2015-02-22 02:46:21 -06:00
use Carbon\Carbon;
2015-12-28 00:35:09 -06:00
use DaveJamesMiller\Breadcrumbs\Generator as BreadCrumbGenerator;
2016-02-10 07:36:21 -06:00
use FireflyIII\Exceptions\FireflyException;
2015-02-22 08:40:13 -06:00
use FireflyIII\Models\Account;
2016-02-10 07:36:21 -06:00
use FireflyIII\Models\Attachment;
2015-02-25 08:19:14 -06:00
use FireflyIII\Models\Bill;
2015-03-29 14:27:51 -05:00
use FireflyIII\Models\Budget;
2015-02-23 14:19:16 -06:00
use FireflyIII\Models\Category;
2015-02-22 08:40:13 -06:00
use FireflyIII\Models\LimitRepetition;
2015-02-24 14:10:25 -06:00
use FireflyIII\Models\PiggyBank;
2016-02-10 07:36:21 -06:00
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup;
2015-05-03 05:58:55 -05:00
use FireflyIII\Models\Tag;
2015-05-02 03:40:20 -05:00
use FireflyIII\Models\TransactionCurrency;
2015-03-29 14:27:51 -05:00
use FireflyIII\Models\TransactionJournal;
2015-05-03 05:58:55 -05:00
2016-02-10 07:36:21 -06:00
/**
* HOME
2015-02-22 02:46:21 -06:00
*/
Breadcrumbs::register(
'home',
2015-12-28 00:35:09 -06:00
function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->push(trans('breadcrumbs.home'), route('index'));
2015-02-22 02:46:21 -06:00
}
);
2015-05-01 11:44:49 -05:00
Breadcrumbs::register(
'index',
2015-12-28 00:35:09 -06:00
function (BreadCrumbGenerator $breadcrumbs) {
2015-05-01 11:44:49 -05:00
$breadcrumbs->push(trans('breadcrumbs.home'), route('index'));
2015-05-01 11:44:49 -05:00
}
);
2016-02-10 07:36:21 -06:00
/**
* ACCOUNTS
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2016-02-05 02:25:15 -06:00
'accounts.index', function (BreadCrumbGenerator $breadcrumbs, string $what) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.' . strtolower(e($what)) . '_accounts'), route('accounts.index', [$what]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-05 02:25:15 -06:00
'accounts.create', function (BreadCrumbGenerator $breadcrumbs, string $what) {
$breadcrumbs->parent('accounts.index', $what);
2015-08-23 00:41:12 -05:00
$breadcrumbs->push(trans('firefly.new_' . strtolower(e($what)) . '_account'), route('accounts.create', [$what]));
}
);
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'accounts.show', function (BreadCrumbGenerator $breadcrumbs, Account $account) {
2016-04-26 14:40:15 -05:00
$what = config('firefly.shortNamesByFullName.' . $account->accountType->type);
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('accounts.index', $what);
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(e($account->name), route('accounts.show', [$account->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
'accounts.show.date', function (BreadCrumbGenerator $breadcrumbs, Account $account, Carbon $date) {
$breadcrumbs->parent('accounts.show', $account);
$range = Preferences::get('viewRange', '1M')->data;
$title = $account->name . ' (' . Navigation::periodShow($date, $range) . ')';
$breadcrumbs->push($title, route('accounts.show.date', [$account->id, $date->format('Y-m-d')]));
}
);
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'accounts.delete', function (BreadCrumbGenerator $breadcrumbs, Account $account) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('accounts.show', $account);
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.delete_account', ['name' => e($account->name)]), route('accounts.delete', [$account->id]));
2015-02-22 02:46:21 -06:00
}
);
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'accounts.edit', function (BreadCrumbGenerator $breadcrumbs, Account $account) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('accounts.show', $account);
2016-04-26 14:40:15 -05:00
$what = config('firefly.shortNamesByFullName.' . $account->accountType->type);
2015-05-21 00:30:38 -05:00
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.edit_' . $what . '_account', ['name' => e($account->name)]), route('accounts.edit', [$account->id]));
2015-02-22 02:46:21 -06:00
}
);
/**
* ADMIN
*/
Breadcrumbs::register(
'admin.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('firefly.administration'), route('admin.index'));
}
);
Breadcrumbs::register(
'admin.users', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('admin.index');
$breadcrumbs->push(trans('firefly.list_all_users'), route('admin.users'));
}
);
2016-08-03 23:14:08 -05:00
Breadcrumbs::register(
'admin.users.domains', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('admin.index');
$breadcrumbs->push(trans('firefly.blocked_domains'), route('admin.users.domains'));
}
);
Breadcrumbs::register(
'admin.configuration.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('admin.index');
$breadcrumbs->push(trans('firefly.instance_configuration'), route('admin.configuration.index'));
}
);
2016-02-10 07:36:21 -06:00
/**
* ATTACHMENTS
*/
Breadcrumbs::register(
'attachments.edit', function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) {
$object = $attachment->attachable;
if ($object instanceof TransactionJournal) {
$breadcrumbs->parent('transactions.show', $object);
2016-02-10 09:23:37 -06:00
$breadcrumbs->push($attachment->filename, route('attachments.edit', [$attachment]));
2016-02-10 07:36:21 -06:00
} else {
throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object));
}
}
);
Breadcrumbs::register(
'attachments.delete', function (BreadCrumbGenerator $breadcrumbs, Attachment $attachment) {
$object = $attachment->attachable;
if ($object instanceof TransactionJournal) {
$breadcrumbs->parent('transactions.show', $object);
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.delete_attachment', ['name' => $attachment->filename]), route('attachments.edit', [$attachment]));
2016-02-10 07:36:21 -06:00
} else {
throw new FireflyException('Cannot make breadcrumb for attachment connected to object of type ' . get_class($object));
}
}
);
/**
* BILLS
*/
Breadcrumbs::register(
'bills.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.bills'), route('bills.index'));
}
);
Breadcrumbs::register(
'bills.create', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('bills.index');
$breadcrumbs->push(trans('breadcrumbs.newBill'), route('bills.create'));
}
);
Breadcrumbs::register(
'bills.edit', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) {
$breadcrumbs->parent('bills.show', $bill);
$breadcrumbs->push(trans('breadcrumbs.edit_bill', ['name' => e($bill->name)]), route('bills.edit', [$bill->id]));
}
);
Breadcrumbs::register(
'bills.delete', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) {
$breadcrumbs->parent('bills.show', $bill);
$breadcrumbs->push(trans('breadcrumbs.delete_bill', ['name' => e($bill->name)]), route('bills.delete', [$bill->id]));
}
);
Breadcrumbs::register(
'bills.show', function (BreadCrumbGenerator $breadcrumbs, Bill $bill) {
$breadcrumbs->parent('bills.index');
$breadcrumbs->push(e($bill->name), route('bills.show', [$bill->id]));
}
);
/**
* BUDGETS
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.index', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.budgets'), route('budgets.index'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.create', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('budgets.index');
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.create_new_budget'), route('budgets.create'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.edit', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('budgets.show', $budget);
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.edit_budget', ['name' => e($budget->name)]), route('budgets.edit', [$budget->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.delete', function (BreadCrumbGenerator $breadcrumbs, Budget $budget) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('budgets.show', $budget);
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.delete_budget', ['name' => e($budget->name)]), route('budgets.delete', [$budget->id]));
2015-02-22 02:46:21 -06:00
}
);
2015-05-02 02:31:57 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.noBudget', function (BreadCrumbGenerator $breadcrumbs, $subTitle) {
2015-05-02 02:31:57 -05:00
$breadcrumbs->parent('budgets.index');
$breadcrumbs->push($subTitle, route('budgets.noBudget'));
}
);
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'budgets.show', function (BreadCrumbGenerator $breadcrumbs, Budget $budget, LimitRepetition $repetition = null) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('budgets.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(e($budget->name), route('budgets.show', [$budget->id]));
2015-02-22 08:40:13 -06:00
if (!is_null($repetition) && !is_null($repetition->id)) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->push(
2015-05-26 13:37:01 -05:00
Navigation::periodShow($repetition->startdate, $repetition->budgetLimit->repeat_freq), route('budgets.show', [$budget->id, $repetition->id])
2015-02-22 02:46:21 -06:00
);
}
}
);
2016-02-10 07:36:21 -06:00
/**
* CATEGORIES
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.index', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.categories'), route('categories.index'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.create', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('categories.index');
2015-08-23 00:41:12 -05:00
$breadcrumbs->push(trans('firefly.new_category'), route('categories.create'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.edit', function (BreadCrumbGenerator $breadcrumbs, Category $category) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('categories.show', $category);
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.edit_category', ['name' => e($category->name)]), route('categories.edit', [$category->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.delete', function (BreadCrumbGenerator $breadcrumbs, Category $category) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('categories.show', $category);
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.delete_category', ['name' => e($category->name)]), route('categories.delete', [$category->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.show', function (BreadCrumbGenerator $breadcrumbs, Category $category) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('categories.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(e($category->name), route('categories.show', [$category->id]));
2015-02-22 02:46:21 -06:00
}
);
2015-09-25 09:33:45 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.show.date', function (BreadCrumbGenerator $breadcrumbs, Category $category, Carbon $date) {
2015-09-25 09:33:45 -05:00
// get current period preference.
$range = Preferences::get('viewRange', '1M')->data;
$breadcrumbs->parent('categories.index');
$breadcrumbs->push(e($category->name), route('categories.show', [$category->id]));
$breadcrumbs->push(Navigation::periodShow($date, $range), route('categories.show.date', [$category->id, $date->format('Y-m-d')]));
}
);
2015-05-02 02:31:57 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'categories.noCategory', function (BreadCrumbGenerator $breadcrumbs, $subTitle) {
2015-05-02 02:31:57 -05:00
$breadcrumbs->parent('categories.index');
$breadcrumbs->push($subTitle, route('categories.noCategory'));
}
);
2016-02-10 07:36:21 -06:00
/**
* CURRENCIES
*/
2015-05-02 03:40:20 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'currency.index', function (BreadCrumbGenerator $breadcrumbs) {
2015-05-02 03:40:20 -05:00
$breadcrumbs->parent('home');
2015-06-11 11:32:31 -05:00
$breadcrumbs->push(trans('firefly.currencies'), route('currency.index'));
2015-05-02 03:40:20 -05:00
}
);
2015-06-21 08:09:10 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'currency.create', function (BreadCrumbGenerator $breadcrumbs) {
2015-06-21 08:09:10 -05:00
$breadcrumbs->parent('currency.index');
$breadcrumbs->push(trans('firefly.create_currency'), route('currency.create'));
}
);
2015-05-02 03:40:20 -05:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'currency.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) {
2015-05-02 03:40:20 -05:00
$breadcrumbs->parent('currency.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(trans('breadcrumbs.edit_currency', ['name' => e($currency->name)]), route('currency.edit', [$currency->id]));
2015-05-02 03:40:20 -05:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'currency.delete', function (BreadCrumbGenerator $breadcrumbs, TransactionCurrency $currency) {
2015-05-02 03:40:20 -05:00
$breadcrumbs->parent('currency.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(trans('breadcrumbs.delete_currency', ['name' => e($currency->name)]), route('currency.delete', [$currency->id]));
2015-05-02 03:40:20 -05:00
}
);
2016-02-10 07:36:21 -06:00
/**
* EXPORT
*/
Breadcrumbs::register(
'export.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('firefly.export_data'), route('export.index'));
}
);
2015-02-22 02:46:21 -06:00
2016-02-10 07:36:21 -06:00
/**
* PIGGY BANKS
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'piggy-banks.index', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
2015-08-23 00:41:12 -05:00
$breadcrumbs->push(trans('firefly.piggyBanks'), route('piggy-banks.index'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'piggy-banks.create', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-24 14:10:25 -06:00
$breadcrumbs->parent('piggy-banks.index');
$breadcrumbs->push(trans('breadcrumbs.newPiggyBank'), route('piggy-banks.create'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'piggy-banks.edit', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) {
2015-02-24 14:10:25 -06:00
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(trans('breadcrumbs.edit_piggyBank', ['name' => e($piggyBank->name)]), route('piggy-banks.edit', [$piggyBank->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'piggy-banks.delete', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) {
2015-02-24 14:10:25 -06:00
$breadcrumbs->parent('piggy-banks.show', $piggyBank);
2015-08-23 00:41:12 -05:00
$breadcrumbs->push(trans('firefly.delete_piggy_bank', ['name' => e($piggyBank->name)]), route('piggy-banks.delete', [$piggyBank->id]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'piggy-banks.show', function (BreadCrumbGenerator $breadcrumbs, PiggyBank $piggyBank) {
2015-02-24 14:10:25 -06:00
$breadcrumbs->parent('piggy-banks.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(e($piggyBank->name), route('piggy-banks.show', [$piggyBank->id]));
2015-02-22 02:46:21 -06:00
}
);
2016-02-10 07:36:21 -06:00
/**
* PREFERENCES
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'preferences', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences'));
2015-02-22 02:46:21 -06:00
}
);
2016-03-03 15:02:08 -06:00
Breadcrumbs::register(
'preferences.code', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.preferences'), route('preferences'));
}
);
2016-02-10 07:36:21 -06:00
/**
* PROFILE
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'profile', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.profile'), route('profile'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'profile.change-password', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('profile');
2015-07-26 00:41:10 -05:00
$breadcrumbs->push(trans('breadcrumbs.changePassword'), route('profile.change-password'));
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'profile.delete-account', function (BreadCrumbGenerator $breadcrumbs) {
2015-07-26 00:41:10 -05:00
$breadcrumbs->parent('profile');
$breadcrumbs->push(trans('firefly.delete_account'), route('profile.delete-account'));
2015-02-22 02:46:21 -06:00
}
);
2016-02-10 07:36:21 -06:00
/**
* REPORTS
*/
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'reports.index', function (BreadCrumbGenerator $breadcrumbs) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.reports'), route('reports.index'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'reports.report', function (BreadCrumbGenerator $breadcrumbs, Carbon $start, Carbon $end, $reportType, $accountIds) {
2015-02-22 02:46:21 -06:00
$breadcrumbs->parent('reports.index');
$monthFormat = (string)trans('config.month_and_day');
$title = (string)trans(
'firefly.report_' . $reportType,
['start' => $start->formatLocalized($monthFormat), 'end' => $end->formatLocalized($monthFormat)]
);
2015-05-15 14:01:24 -05:00
2016-01-01 14:59:19 -06:00
$breadcrumbs->push($title, route('reports.report', [$reportType, $start->format('Ymd'), $end->format('Ymd'), $accountIds]));
2015-02-22 02:46:21 -06:00
}
);
2016-01-11 13:41:43 -06:00
/**
* Rules
*/
Breadcrumbs::register(
'rules.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('firefly.rules'), route('rules.index'));
}
);
2015-02-22 02:46:21 -06:00
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule.create', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) {
$breadcrumbs->parent('rules.index');
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.make_new_rule', ['title' => $ruleGroup->title]), route('rules.rule.create', [$ruleGroup]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule.edit', function (BreadCrumbGenerator $breadcrumbs, Rule $rule) {
$breadcrumbs->parent('rules.index');
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.edit_rule', ['title' => $rule->title]), route('rules.rule.edit', [$rule]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule.delete', function (BreadCrumbGenerator $breadcrumbs, Rule $rule) {
$breadcrumbs->parent('rules.index');
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.delete_rule', ['title' => $rule->title]), route('rules.rule.delete', [$rule]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule-group.create', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('rules.index');
$breadcrumbs->push(trans('firefly.make_new_rule_group'), route('rules.rule-group.create'));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule-group.edit', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) {
$breadcrumbs->parent('rules.index');
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.edit_rule_group', ['title' => $ruleGroup->title]), route('rules.rule-group.edit', [$ruleGroup]));
2015-02-22 02:46:21 -06:00
}
);
Breadcrumbs::register(
2016-02-10 07:36:21 -06:00
'rules.rule-group.delete', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) {
$breadcrumbs->parent('rules.index');
2016-02-10 09:23:37 -06:00
$breadcrumbs->push(trans('firefly.delete_rule_group', ['title' => $ruleGroup->title]), route('rules.rule-group.delete', [$ruleGroup]));
2016-02-10 07:36:21 -06:00
}
);
2015-02-22 02:46:21 -06:00
2016-02-23 09:03:05 -06:00
Breadcrumbs::register(
'rules.rule-group.select_transactions', function (BreadCrumbGenerator $breadcrumbs, RuleGroup $ruleGroup) {
$breadcrumbs->parent('rules.index');
$breadcrumbs->push(
trans('firefly.execute_group_on_existing_transactions', ['title' => $ruleGroup->title]), route('rules.rule-group.select_transactions', [$ruleGroup])
);
2016-02-23 09:03:05 -06:00
}
);
2015-02-22 02:46:21 -06:00
2016-02-10 07:36:21 -06:00
/**
* SEARCH
*/
Breadcrumbs::register(
'search', function (BreadCrumbGenerator $breadcrumbs, $query) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.searchResult', ['query' => e($query)]), route('search'));
2015-02-22 02:46:21 -06:00
}
);
2016-05-15 05:26:40 -05:00
2016-02-10 07:36:21 -06:00
/**
* TAGS
*/
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'tags.index', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.tags'), route('tags.index'));
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'tags.create', function (BreadCrumbGenerator $breadcrumbs) {
$breadcrumbs->parent('tags.index');
$breadcrumbs->push(trans('breadcrumbs.createTag'), route('tags.create'));
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'tags.edit', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) {
$breadcrumbs->parent('tags.show', $tag);
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(trans('breadcrumbs.edit_tag', ['tag' => e($tag->tag)]), route('tags.edit', [$tag->id]));
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'tags.delete', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) {
$breadcrumbs->parent('tags.show', $tag);
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(trans('breadcrumbs.delete_tag', ['tag' => e($tag->tag)]), route('tags.delete', [$tag->id]));
}
);
Breadcrumbs::register(
2015-12-28 00:35:09 -06:00
'tags.show', function (BreadCrumbGenerator $breadcrumbs, Tag $tag) {
$breadcrumbs->parent('tags.index');
2015-05-26 13:37:01 -05:00
$breadcrumbs->push(e($tag->tag), route('tags.show', [$tag->id]));
}
);
2016-02-10 07:36:21 -06:00
/**
* TRANSACTIONS
*/
Breadcrumbs::register(
'transactions.index', function (BreadCrumbGenerator $breadcrumbs, string $what) {
$breadcrumbs->parent('home');
$breadcrumbs->push(trans('breadcrumbs.' . $what . '_list'), route('transactions.index', [$what]));
}
);
Breadcrumbs::register(
'transactions.create', function (BreadCrumbGenerator $breadcrumbs, string $what) {
$breadcrumbs->parent('transactions.index', $what);
$breadcrumbs->push(trans('breadcrumbs.create_' . e($what)), route('transactions.create', [$what]));
}
);
Breadcrumbs::register(
'transactions.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) {
$breadcrumbs->parent('transactions.show', $journal);
$breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('transactions.edit', [$journal->id]));
}
);
Breadcrumbs::register(
'transactions.delete', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) {
$breadcrumbs->parent('transactions.show', $journal);
$breadcrumbs->push(trans('breadcrumbs.delete_journal', ['description' => e($journal->description)]), route('transactions.delete', [$journal->id]));
}
);
Breadcrumbs::register(
'transactions.show', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) {
2016-03-14 14:38:23 -05:00
$what = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
$breadcrumbs->parent('transactions.index', $what);
2016-02-10 07:36:21 -06:00
$breadcrumbs->push($journal->description, route('transactions.show', [$journal->id]));
}
2016-02-10 09:01:18 -06:00
);
2016-05-15 05:26:40 -05:00
/**
* SPLIT
*/
Breadcrumbs::register(
'split.journal.edit', function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) {
$breadcrumbs->parent('transactions.show', $journal);
$breadcrumbs->push(trans('breadcrumbs.edit_journal', ['description' => $journal->description]), route('split.journal.edit', [$journal->id]));
}
);
Breadcrumbs::register(
'split.journal.create', function (BreadCrumbGenerator $breadcrumbs, string $what) {
$breadcrumbs->parent('transactions.index', $what);
$breadcrumbs->push(trans('breadcrumbs.create_' . e($what)), route('split.journal.create', [$what]));
}
2016-08-12 08:10:03 -05:00
);