{{-- Note moyenne en étoiles sur une carte du catalogue. Attend $avg et $count. --}} @php $avg = round($avg ?? 0, 1); $fullStars = floor($avg); $hasHalfStar = ($avg - $fullStars) >= 0.5; @endphp
@for($i = 1; $i <= 5; $i++) @if($i <= $fullStars) @elseif($i == $fullStars + 1 && $hasHalfStar) @else @endif @endfor {{ $avg }}/5 @if($count ?? false) ({{ $count }}) @endif