Simplify controllers

This commit is contained in:
James Cole
2017-07-30 13:42:30 +02:00
parent 8fcdb91ba3
commit c39c5492ea
9 changed files with 27 additions and 25 deletions

View File

@@ -71,7 +71,7 @@ class TransactionController extends Controller
// default values:
$subTitleIcon = config('firefly.transactionIconsByWhat.' . $what);
$types = config('firefly.transactionTypesByWhat.' . $what);
$page = intval($request->get('page')) === 0 ? 1 : intval($request->get('page'));
$page = intval($request->get('page'));
$pageSize = intval(Preferences::get('transactionPageSize', 50)->data);
$count = 0;
$loop = 0;
@@ -94,7 +94,7 @@ class TransactionController extends Controller
if (strlen($moment) > 0 && $moment !== 'all') {
$start = new Carbon($moment);
$end = Navigation::endOfPeriod($start, $range);
$path = route('transactions.index', [$what, $moment]);
$path = route('transactions.index', [$what, $moment]);
$subTitle = trans(
'firefly.title_' . $what . '_between',
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]