<div class="rating1" style="font-size:12px;text-align:left;">
    <?php
        if ($product->reviews->count() > 0) {
            $average_rating = $product->reviews->sum('rating') / $product->reviews->count();
        } else {
            $average_rating = 0;
        }
    ?>
    <div>
        <?php if($average_rating == 0): ?>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating > 0 && $average_rating < 1.5): ?>
            <i class="fas fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 1.5 && $average_rating < 2): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star-half-alt"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 2 && $average_rating < 2.5): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 2.5 && $average_rating < 3): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star-half-alt"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 3 && $average_rating < 3.5): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="far fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 3.5 && $average_rating < 4): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star-half-alt"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 4 && $average_rating < 4.5): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="far fa-star"></i>
        <?php elseif($average_rating >= 4.5 && $average_rating < 5): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star-half-alt"></i>
        <?php elseif($average_rating >= 5): ?>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
            <i class="fas fa-star"></i>
        <?php endif; ?>
        <!-- <span style="color: #333;display: inline-block;">(<?php echo e($average_rating); ?>)</span> -->
    </div>
</div><?php /**PATH /home/apleefix/shopping.apleefix.com/resources/views/components/parts-product-grid-view/rating.blade.php ENDPATH**/ ?>