Filter

@foreach($rooms as $roomType => $roomList)

{{ $roomType }} Inventory

@for($i = 0; $i < 17; $i++) @endfor @foreach($roomList as $room) @foreach($room->rates as $rate) @for($i = 0; $i < 17; $i++) @php $currentDate=$startDate-> copy()->addDays($i); $numRoomsBooked = 0; foreach ($room->bookings as $booking) { $checkIn = Carbon\Carbon::parse($booking->check_in)->startOfDay(); $checkOut = Carbon\Carbon::parse($booking->check_out)->endOfDay(); if ($currentDate->between($checkIn, $checkOut) && in_array($booking->status, ['blocked', 'booked'])) { $numRoomsBooked++; } } $numRoom = $room->no - $numRoomsBooked; // Check for review rate $reviewRate = $room->reviewRates ->where('rate_name', $rate->name) ->where('check_in', '<=', $currentDate) ->where('check_out', '>=', $currentDate) ->first(); $displayRate = $reviewRate ? $reviewRate->rate : $rate->rate; @endphp @endfor @endforeach @endforeach
Room Type Rate {{ $startDate->copy()->addDays($i)->format('d M') }}
{{ $rate->name }} Rates {{ number_format($displayRate) }} ID: {{$rate->id}}

@if($numRoom < 1) {{ $numRoom }} rooms @else {{ $numRoom }} rooms @endif
@endforeach