/**
* @param PrepareApiData $event
*/
public function loadTagsRelationship(PrepareApiData $event)
{
// Expose the complete tag list to clients by adding it as a
// relationship to the /api/forum endpoint. Since the Forum model
// doesn't actually have a tags relationship, we will manually load and
// assign the tags data to it using an event listener.
if ($event->isController(ShowForumController::class)) {
$event->data['tags'] = Tag::whereVisibleTo($event->actor)->with('lastDiscussion')->get();
}
}