Eager load mentionedBy and only missing relations (#64)

This commit is contained in:
Sami Mazouz 2021-03-25 15:37:47 +01:00 committed by GitHub
parent 613664525d
commit 46aabd2ae5

View File

@ -66,7 +66,7 @@ class FilterVisiblePosts
// Load all of the users that these posts mention. This way the data // 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 // will be ready to go when we need to sub in current usernames
// during the rendering process. // 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 // 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 // have been mentioned in. We can then filter this list of IDs to