@extends('layouts.app') @section('title', 'Room ' . $room->room_number) @section('content')

{{ $room->hostel->name }} — Room {{ $room->room_number }}

{{ $room->allocations->count() }} / {{ $room->bed_capacity }} beds occupied

@for($i = 1; $i <= $room->bed_capacity; $i++) @php $allocation = $room->allocations->firstWhere('bed_number', $i); @endphp @endfor
Bed No.Student
Bed {{ $i }} {{ $allocation?->student->full_name ?? '— Empty —' }}
@endsection