{{ number_format($reviewsSummary['average'] ?? 0, 1) }}

@for($i = 1; $i <= 5; $i++) @endfor

{{ $reviewsSummary['total'] ?? 0 }} reviews

Rating Distribution
@foreach(range(5, 1) as $rating) @php $count = $reviewsSummary['distribution'][$rating] ?? 0; $total = $reviewsSummary['total'] ?? 1; $percentage = $total > 0 ? round(($count / $total) * 100) : 0; @endphp
{{ $rating }}
{{ $count }}
@endforeach
{{-- Reviews List --}}
@if($product->reviews->count() > 0)
@foreach($product->reviews->take(10) as $review)
{{ $review->user?->username ?? 'Anonymous' }}
@for($i = 1; $i <= 5; $i++) @endfor
{{ $review->review ?? 'No comment provided.' }}
{{ $review->created_at?->diffForHumans() }}
@endforeach
@if($product->reviews->count() > 10)
View All Reviews
@endif @else
No reviews for this product yet
@endif