Eagerload lastPostedDiscussion needed relationships (#120)

This commit is contained in:
Sami Mazouz 2021-03-06 16:37:26 +01:00 committed by GitHub
parent 162167fe23
commit b78b097724

View File

@ -29,7 +29,12 @@ class LoadForumTagsRelationship
// assign the tags data to it using an event listener. // assign the tags data to it using an event listener.
$data['tags'] = Tag::whereVisibleTo($actor) $data['tags'] = Tag::whereVisibleTo($actor)
->withStateFor($actor) ->withStateFor($actor)
->with(['parent', 'lastPostedDiscussion']) ->with([
'parent',
'lastPostedDiscussion',
'lastPostedDiscussion.tags',
'lastPostedDiscussion.state'
])
->get(); ->get();
} }
} }