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