@php $positivComments = $plan->comments()->where('grade', '>', '3'); $negativeComments = $plan->comments()->where('grade', '<=', '3'); $positiveCommmentsCount = $positivComments->count(); $negativeCommentsCount = $negativeComments->count(); @endphp
@foreach($positivComments->get() as $comment)
{{ $comment->author->name }} {{ $comment->body }}
{{ $comment->grade }}
@livewire('plan.comment.upvote', ['comment' => $comment])
@endforeach
@foreach($negativeComments->get() as $comment)
{{ $comment->author->name }} {{ $comment->body }}
{{ $comment->grade }}
@livewire('plan.comment.upvote', ['comment' => $comment])
@endforeach