From a0f9aab560666356b728d085a0b16ac6b7374393 Mon Sep 17 00:00:00 2001 From: Jonathan Reinink Date: Tue, 2 Apr 2019 15:08:52 -0400 Subject: [PATCH] Eager load organizations on contacts index --- app/Http/Controllers/ContactsController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Http/Controllers/ContactsController.php b/app/Http/Controllers/ContactsController.php index 02ccbc3..835dfc8 100644 --- a/app/Http/Controllers/ContactsController.php +++ b/app/Http/Controllers/ContactsController.php @@ -15,6 +15,7 @@ class ContactsController extends Controller return Inertia::render('Contacts/Index', [ 'filters' => Request::all('search', 'trashed'), 'contacts' => Auth::user()->account->contacts() + ->with('organization') ->orderByName() ->filter(Request::only('search', 'trashed')) ->paginate()