N+1 issue solved..

This commit is contained in:
Cüneyt Şentürk 2023-05-25 17:00:57 +03:00
parent a77fecff45
commit 8e67c22fe1

View File

@ -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;