fixed n+1

This commit is contained in:
Denis Duliçi
2021-06-04 12:42:38 +03:00
parent 434bd1462f
commit a42429bf12
4 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ class Vendors extends Controller
}
// Handle payments
$transactions = Transaction::with('category')->where('contact_id', $vendor->id)->expense()->get();
$transactions = Transaction::with('account', 'category')->where('contact_id', $vendor->id)->expense()->get();
$counts['transactions'] = $transactions->count();