From df725cace6f8f23834faf49f658b83f71c80564f Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Thu, 26 Aug 2021 21:57:36 +0100 Subject: [PATCH] perf: Eager load actor tag states (#143) --- extensions/tags/src/LoadForumTagsRelationship.php | 1 + extensions/tags/src/Tag.php | 1 + 2 files changed, 2 insertions(+) diff --git a/extensions/tags/src/LoadForumTagsRelationship.php b/extensions/tags/src/LoadForumTagsRelationship.php index cd1328b42..8ef3db33f 100755 --- a/extensions/tags/src/LoadForumTagsRelationship.php +++ b/extensions/tags/src/LoadForumTagsRelationship.php @@ -42,6 +42,7 @@ class LoadForumTagsRelationship ->limit(4) // We get one more than we need so the "more" link can be shown. ) ->whereVisibleTo($actor) + ->withStateFor($actor) ->get(); } } diff --git a/extensions/tags/src/Tag.php b/extensions/tags/src/Tag.php index 134d64e9a..b83460adf 100644 --- a/extensions/tags/src/Tag.php +++ b/extensions/tags/src/Tag.php @@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Builder; * @property int $last_posted_discussion_id * @property int $last_posted_user_id * @property string $icon + * @property TagState */ class Tag extends AbstractModel {