diff --git a/src/Seeders/CommentSeeder.php b/src/Seeders/CommentSeeder.php index 85a21d6..6553608 100644 --- a/src/Seeders/CommentSeeder.php +++ b/src/Seeders/CommentSeeder.php @@ -20,9 +20,20 @@ class CommentSeeder extends Seeder public function query(): Builder { + $includes = ['discussion']; + + if ($this->extensionEnabled('flarum-tags')) { + $includes[] = 'discussion.tags'; + } + + if ($this->extensionEnabled('fof-byobu')) { + $includes[] = 'discussion.recipientUsers'; + $includes[] = 'discussion.recipientGroups'; + } + return CommentPost::query() ->where('type', CommentPost::$type) - ->with('discussion'); + ->with($includes); } public static function savingOn(Dispatcher $events, callable $callable) diff --git a/src/Seeders/DiscussionSeeder.php b/src/Seeders/DiscussionSeeder.php index a662ae4..ef01c71 100644 --- a/src/Seeders/DiscussionSeeder.php +++ b/src/Seeders/DiscussionSeeder.php @@ -22,7 +22,18 @@ class DiscussionSeeder extends Seeder public function query(): Builder { - return Discussion::query(); + $includes = []; + + if ($this->extensionEnabled('flarum-tags')) { + $includes[] = 'tags'; + } + + if ($this->extensionEnabled('fof-byobu')) { + $includes[] = 'recipientUsers'; + $includes[] = 'recipientGroups'; + } + return Discussion::query() + ->with($includes); } public static function savingOn(Dispatcher $events, callable $callable)