I'm modifying inside the tags extension. Here's what I have so far:
WillGetData Event:
if ($event->isController(Controller\ListPostsController::class)) {
$event->addInclude(['discussion.tags']);
}
GetApiRelationship Event:
if ($event->isRelationship(PostSerializer::class, 'discussion')) {
return $event->serializer->hasMany($event->model, 'Flarum\Tags\Api\Serializer\TagSerializer', 'tags');
}
Appreciate any help, thanks!