@extends('layouts.app') @section('content')

Available Time Slots for {{ $ground->name }} on {{ $date }}

@foreach($timeSlots as $slot) @php $isBooked = $bookings->contains(function($booking) use ($slot) { return $booking->start_time <= $slot->end_time && $booking->end_time >= $slot->start_time; }); @endphp
@if ($isBooked)

{{ $slot->start_time }} - {{ $slot->end_time }}: Booked

@else

{{ $slot->start_time }} - {{ $slot->end_time }}: Available at {{ $slot->price }} /hr

@csrf
@endif
@endforeach @endsection