@props(['product']) @php // Fetch the combined (real + fake) reviews from our accessor // display_reviews returns a Collection $reviews = $product->display_reviews ?? collect([]); // We should compute the average rating taking fake reviews into account // if the toggle is enabled, or fallback to real rating. $totalReviews = $reviews->count(); $averageRating = $totalReviews > 0 ? round($reviews->avg('rating'), 1) : 0; @endphp
Be the first to review this product.