Rooms

Manage and organize your room directory.

@can('owner-admin') Add New Room @endcan
View Room Assets
@if(request('search')) Clear @endif
@if($rooms->count() > 0) @php $sort = request('sort'); $noDesc = $sort === 'room_no_desc'; $noAsc = $sort === 'room_no_asc'; $nextNoSort = $noAsc ? 'room_no_desc' : 'room_no_asc'; $dateDesc = $sort === 'newest'; $dateAsc = is_null($sort) || $sort === 'oldest'; $nextDateSort = $dateAsc ? 'newest' : 'oldest'; @endphp @can('owner-admin') @endcan @foreach($rooms as $room) @php $status = $room->status; $badge = match ($status) { 'Vacant' => 'bg-green-100 text-green-800', 'Occupied' => 'bg-amber-100 text-amber-800', 'Maintenance' => 'bg-blue-100 text-blue-800', default => 'bg-gray-100 text-gray-800', }; $assetNames = $room->assets->pluck('name')->filter()->unique()->values(); @endphp @can('owner-admin') @endcan @endforeach
Room No @if($noAsc) @elseif($noDesc) @endif Type Status Owner Address Assets Created @if($dateAsc) @elseif($dateDesc) @endif Actions
{{ mb_strtoupper(mb_substr($room->room_no?? 'P', 0, 1, 'UTF-8')) }}
{{ $room->room_type ?? '-' }} {{ $room->status ?? '-' }}
{{ $room->unit->owner->user->name ?? '-' }}
{{ $room->unit->owner->user->email ?? '-' }}
{{ $room->unit->property->address . ', ' . $room->unit->property->city . ', ' . $room->unit->property->postcode . ' ' . $room->unit->property->state ?? 'No address set for this property' }} @if($assetNames->count())
@foreach($assetNames as $n) {{ $n }} @endforeach
@else ƒ?" @endif
{{ optional($room->created_at)->format('d M Y') }}
@csrf @method('DELETE')
@else

No rooms found

Try adjusting your search or add a new room.

@endif
@if($rooms->hasPages())
{{ $rooms->appends(request()->query())->links() }}
@endif