{{$category['name']}}

{{$category['description']}}

@if ($gigs)
@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
{{ $gig['title'] }}
{{ $gig['title'] }}
@if ($averageRating > 0)

{{ number_format($averageRating, 1) }}

@endif

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

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

@endforeach
@else @endif