From 26171812481e0860e03fb39da40106cbe06c6a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 6 Jun 2023 13:34:06 +0300 Subject: [PATCH] Account document totals n+1 issue solved.. --- app/Http/Controllers/Banking/Accounts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Banking/Accounts.php b/app/Http/Controllers/Banking/Accounts.php index e00e45bdf..a8bcfcc5f 100644 --- a/app/Http/Controllers/Banking/Accounts.php +++ b/app/Http/Controllers/Banking/Accounts.php @@ -35,7 +35,7 @@ class Accounts extends Controller */ public function show(Account $account) { - $transactions = Transaction::with('category', 'contact', 'contact.media', 'document', 'document.media', 'recurring', 'media')->where('account_id', $account->id)->collect(['paid_at'=> 'desc']); + $transactions = Transaction::with('category', 'contact', 'contact.media', 'document', 'document.totals', 'document.media', 'recurring', 'media')->where('account_id', $account->id)->collect(['paid_at'=> 'desc']); $transfers = Transfer::with('expense_transaction', 'expense_transaction.account', 'income_transaction', 'income_transaction.account') ->whereHas('expense_transaction', fn ($query) => $query->where('account_id', $account->id))