fix: include replies in comment count and cascade delete to replies
This commit is contained in:
@@ -80,6 +80,12 @@ class Comments extends Component implements HasForms
|
||||
return $this->model->topLevelComments()->count();
|
||||
}
|
||||
|
||||
#[Computed]
|
||||
public function allCommentsCount(): int
|
||||
{
|
||||
return $this->model->commentCount();
|
||||
}
|
||||
|
||||
#[Computed]
|
||||
public function hasMore(): bool
|
||||
{
|
||||
@@ -203,7 +209,7 @@ class Comments extends Component implements HasForms
|
||||
|
||||
public function refreshComments(): void
|
||||
{
|
||||
unset($this->comments, $this->totalCount, $this->hasMore);
|
||||
unset($this->comments, $this->totalCount, $this->hasMore, $this->allCommentsCount);
|
||||
}
|
||||
|
||||
public function render(): View
|
||||
|
||||
Reference in New Issue
Block a user