From 8e67c22fe1cf2a6de69ad57ae9495bdb8c38a340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 25 May 2023 17:00:57 +0300 Subject: [PATCH] N+1 issue solved.. --- app/Widgets/AccountBalance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Widgets/AccountBalance.php b/app/Widgets/AccountBalance.php index fbe315e58..4be0e8666 100644 --- a/app/Widgets/AccountBalance.php +++ b/app/Widgets/AccountBalance.php @@ -15,7 +15,7 @@ class AccountBalance extends Widget public function show() { - $accounts = Account::with('income_transactions', 'expense_transactions')->enabled()->take(5)->get()->map(function($account) { + $accounts = Account::with('transactions')->enabled()->take(5)->get()->map(function($account) { $account->balance_formatted = money($account->balance, $account->currency_code, true); return $account;