@props(['rating' => 0]) {{-- Define a 'rating' prop with a default value of 0 --}}

@for($star = 1; $star <= 5; $star++)
    @if ($star <= $rating) {{-- Use the 'rating' prop instead of $comment->rate --}}
        <span style="color:#ff9e0b;">★</span>
    @else
        <span>★</span>
    @endif
@endfor
