1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 01:16:52 +02:00

perf: Eager load actor tag states (#143)

This commit is contained in:
Sami Mazouz
2021-08-26 21:57:36 +01:00
committed by GitHub
parent e8111a6f8f
commit df725cace6
2 changed files with 2 additions and 0 deletions

View File

@@ -42,6 +42,7 @@ class LoadForumTagsRelationship
->limit(4) // We get one more than we need so the "more" link can be shown. ->limit(4) // We get one more than we need so the "more" link can be shown.
) )
->whereVisibleTo($actor) ->whereVisibleTo($actor)
->withStateFor($actor)
->get(); ->get();
} }
} }

View File

@@ -34,6 +34,7 @@ use Illuminate\Database\Eloquent\Builder;
* @property int $last_posted_discussion_id * @property int $last_posted_discussion_id
* @property int $last_posted_user_id * @property int $last_posted_user_id
* @property string $icon * @property string $icon
* @property TagState
*/ */
class Tag extends AbstractModel class Tag extends AbstractModel
{ {