fix: eager load 2nd level replies so all nesting levels render correctly

This commit is contained in:
ilyapashayan
2026-03-30 19:00:52 +04:00
parent 812556cba2
commit 5e44a4051a
2 changed files with 2 additions and 2 deletions

View File

@@ -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');

View File

@@ -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();