fixed n+1 queries
This commit is contained in:
		@@ -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'));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -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'));
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user