From 46aabd2ae541a7a591e14e914fd97d9bc2c40fc1 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Thu, 25 Mar 2021 15:37:47 +0100 Subject: [PATCH] Eager load mentionedBy and only missing relations (#64) --- extensions/mentions/src/FilterVisiblePosts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/mentions/src/FilterVisiblePosts.php b/extensions/mentions/src/FilterVisiblePosts.php index df72ddbda..4ebb939da 100755 --- a/extensions/mentions/src/FilterVisiblePosts.php +++ b/extensions/mentions/src/FilterVisiblePosts.php @@ -66,7 +66,7 @@ class FilterVisiblePosts // Load all of the users that these posts mention. This way the data // will be ready to go when we need to sub in current usernames // during the rendering process. - $posts->load(['mentionsUsers', 'mentionsPosts.user']); + $posts->loadMissing(['mentionsUsers', 'mentionsPosts.user', 'mentionedBy']); // Construct a list of the IDs of all of the posts that these posts // have been mentioned in. We can then filter this list of IDs to