From e94ccef86ca74dee37ccadccdd6496aa187a86b5 Mon Sep 17 00:00:00 2001 From: David Carr Date: Sun, 22 Sep 2024 01:06:55 +0100 Subject: [PATCH] added eager loading --- src/Controllers/SentEmailsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controllers/SentEmailsController.php b/src/Controllers/SentEmailsController.php index 8f99c5f..fb201ae 100644 --- a/src/Controllers/SentEmailsController.php +++ b/src/Controllers/SentEmailsController.php @@ -12,7 +12,7 @@ class SentEmailsController { public function index(Request $request): View { - $emails = SentEmail::orderby('id', 'desc') + $emails = SentEmail::with('attachments')->orderby('id', 'desc') ->applyFilters($request) ->paginate(config('sentemails.perPage'));