From a30ebc3b9fd9cfe21dafa43b4f9d90b5f57cd87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Fri, 11 Aug 2023 13:05:57 +0300 Subject: [PATCH] Customer and Vendor list page n+1 `media` issue solved.. --- app/Http/Controllers/Purchases/Vendors.php | 2 +- app/Http/Controllers/Sales/Customers.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Purchases/Vendors.php b/app/Http/Controllers/Purchases/Vendors.php index 343be9279..ae7702f19 100644 --- a/app/Http/Controllers/Purchases/Vendors.php +++ b/app/Http/Controllers/Purchases/Vendors.php @@ -30,7 +30,7 @@ class Vendors extends Controller */ public function index() { - $vendors = Contact::with('bills.histories', 'bills.totals', 'bills.transactions', 'media')->vendor()->collect(); + $vendors = Contact::with('media', 'bills.histories', 'bills.totals', 'bills.transactions', 'bills.media')->vendor()->collect(); return $this->response('purchases.vendors.index', compact('vendors')); } diff --git a/app/Http/Controllers/Sales/Customers.php b/app/Http/Controllers/Sales/Customers.php index a55bd7f2b..1c71bd9cd 100644 --- a/app/Http/Controllers/Sales/Customers.php +++ b/app/Http/Controllers/Sales/Customers.php @@ -30,7 +30,7 @@ class Customers extends Controller */ public function index() { - $customers = Contact::customer()->with('invoices.histories', 'invoices.totals', 'invoices.transactions', 'media')->collect(); + $customers = Contact::customer()->with('media', 'invoices.histories', 'invoices.totals', 'invoices.transactions', 'invoices.media')->collect(); return $this->response('sales.customers.index', compact('customers')); }