{{ $property->name }}

{{ $property->address }}, {{ $property->postcode }} {{ $property->city }}
@can('owner-admin') Add New Unit @endcan

Listing Units

@can('owner-admin') @endcan @foreach($property->units as $unit) @php $uStatus = $unit->status; $uBadge = match ($uStatus) { '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', }; @endphp @can('owner-admin') @endcan @endforeach
{{ mb_strtoupper(mb_substr($unit->unit_no ?? 'U', 0, 1, 'UTF-8')) }}
{{ $unit->unit_no }}
{{ $unit->owner->name ?? '-' }}
{{ $unit->owner->email ?? '-' }}
{{ ucfirst($uStatus) }}
{{ $unit->tenant->name ?? 'No Tenant' }}
@if($unit->status == 'Removed' && $property->status != 'Removed') {{-- Restore Unit 按钮 --}}
@csrf @method('PATCH')
@else @if($property->status != 'Removed') {{-- Destroy (Remove) Unit 按钮 --}}
@csrf @method('DELETE')
@endif @endif