@props(['rating', 'max' => 5]) @php $rating = floatval($rating); $fullStars = floor($rating); $hasHalfStar = ($rating - $fullStars) >= 0.5; $emptyStars = $max - $fullStars - ($hasHalfStar ? 1 : 0); @endphp
{{-- النجوم الكاملة --}} @for($i = 0; $i < $fullStars; $i++) @endfor {{-- النجم النصفي --}} @if($hasHalfStar) @endif {{-- النجوم الفارغة --}} @for($i = 0; $i < $emptyStars; $i++) @endfor