Room Management
Manage dental treatment rooms and assignments
{{ session('success') }}
@endif
@if(session('error')) {{ session('error') }}
@endif
@forelse($rooms as $room)
@php
$slots = $room['walk_in_slots'] ?? [];
$apptCount = count($room['appointments_today'] ?? []);
$capacity = array_sum(array_map(fn($s) => (int)($s['capacity'] ?? 0), $slots));
$used = array_sum(array_map(fn($s) => (int)($s['booked_count'] ?? ($s['used_count'] ?? 0)), $slots));
$left = max($capacity - $used, 0);
$currentCount = (int)($room['current_patient_count'] ?? 0);
$waitingCount = (int)($room['waiting_patient_count'] ?? 0);
@endphp
{{ ($room['is_active'] ?? true) ? 'Active' : 'Closed' }}
@empty
{{ $room['room_name'] ?? 'Dental Room' }}
{{ $room['room_type'] ?? 'General Dentistry' }}
{{ $room['doctor_name'] ?? 'Doctor not assigned' }}
{{ ($room['is_active'] ?? true) ? 'Active' : 'Closed' }} · {{ $apptCount }} patients today
Current Patient
{{ $currentCount }}
Waiting Patient
{{ $waitingCount }}
Walk-In Slots
{{ $capacity ?: 0 }} / day · {{ $left }} left
@if(!($room['is_active'] ?? true) && !empty($room['closing_reason']))
Closed: {{ $room['closing_reason'] }}
@endif
No rooms found.
@endforelse