fixed n+1 queries

This commit is contained in:
Denis Duliçi 2023-04-08 11:06:52 -07:00 committed by GitHub
parent 1aa39456e3
commit 827bab48da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class Vendors extends Controller
*/
public function index()
{
$vendors = Contact::with('bills.transactions')->vendor()->collect();
$vendors = Contact::with('bills.histories', 'bills.totals', 'bills.transactions', 'media')->vendor()->collect();
return $this->response('purchases.vendors.index', compact('vendors'));
}

View File

@ -30,7 +30,7 @@ class Customers extends Controller
*/
public function index()
{
$customers = Contact::customer()->with('invoices.transactions')->collect();
$customers = Contact::customer()->with('invoices.histories', 'invoices.totals', 'invoices.transactions', 'media')->collect();
return $this->response('sales.customers.index', compact('customers'));
}