Lots of stuff gets cached now.

This commit is contained in:
James Cole
2015-06-03 18:22:47 +02:00
parent 4b0b79199d
commit a7f6848e53
15 changed files with 286 additions and 242 deletions

View File

@@ -62,9 +62,11 @@ class HomeController extends Controller
public function index(AccountRepositoryInterface $repository)
{
$types = Config::get('firefly.accountTypesByIdentifier.asset');
$count = $repository->countAccounts($types);
if ($count == 0) {
return Redirect::route('new-user.index');
}
@@ -78,8 +80,11 @@ class HomeController extends Controller
$end = Session::get('end', Carbon::now()->endOfMonth());
$accounts = $repository->getFrontpageAccounts($frontPage);
$savings = $repository->getSavingsAccounts();
$piggyBankAccounts = $repository->getPiggyBankAccounts();
$savingsTotal = 0;
foreach ($savings as $savingAccount) {
$savingsTotal += Steam::balance($savingAccount, $end);
@@ -100,7 +105,6 @@ class HomeController extends Controller
$transactions[] = [$set, $account];
}
}
return view('index', compact('count', 'title', 'savings', 'subTitle', 'mainTitleIcon', 'transactions', 'savingsTotal', 'piggyBankAccounts'));
}