{{-- Header Categories --}}
@if ($gigs)

Nearby Services

@foreach ($gigs as $gig)
@php // Get a random image from the gig's image URLs $imageUrls = $gig['image_urls']; $randomImageUrl = $imageUrls[array_rand($imageUrls)]; // Calculate the average star rating $reviews = $gig['reviews']; $totalReviews = count($reviews); $sumRatings = array_sum(array_column($reviews, 'star_rating')); $averageRating = $totalReviews > 0 ? $sumRatings / $totalReviews : 0; @endphp

@if ($averageRating > 0) {{ number_format($averageRating, 1) }} @endif

{{ $gig['title'] }}

{{ $gig['shop']['name'] }} {{ $gig['shop']['name'] }}

{{ $gig['currency'] }}{{ number_format($gig['price']) }}

@endforeach
@else
@endif @if ($canLoadMore)
@endif