From 5e44a4051aac1d72d7726170f0bb44947fca8684 Mon Sep 17 00:00:00 2001 From: ilyapashayan Date: Mon, 30 Mar 2026 19:00:52 +0400 Subject: [PATCH] fix: eager load 2nd level replies so all nesting levels render correctly --- src/Livewire/CommentItem.php | 2 +- src/Livewire/Comments.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Livewire/CommentItem.php b/src/Livewire/CommentItem.php index c4aed95..0a77ef1 100644 --- a/src/Livewire/CommentItem.php +++ b/src/Livewire/CommentItem.php @@ -180,7 +180,7 @@ class CommentItem extends Component implements HasForms app(MentionParser::class)->syncMentions($reply); - $this->comment->load(['replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter']); + $this->comment->load(['replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter', 'replies.replies.commenter', 'replies.replies.mentions', 'replies.replies.attachments', 'replies.replies.reactions.commenter']); $this->dispatch('commentUpdated'); diff --git a/src/Livewire/Comments.php b/src/Livewire/Comments.php index da391de..7a35366 100644 --- a/src/Livewire/Comments.php +++ b/src/Livewire/Comments.php @@ -68,7 +68,7 @@ class Comments extends Component implements HasForms { return $this->model ->topLevelComments() - ->with(['commenter', 'mentions', 'attachments', 'reactions.commenter', 'replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter']) + ->with(['commenter', 'mentions', 'attachments', 'reactions.commenter', 'replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter', 'replies.replies.commenter', 'replies.replies.mentions', 'replies.replies.attachments', 'replies.replies.reactions.commenter']) ->orderBy('created_at', $this->sortDirection) ->take($this->loadedCount) ->get();