@extends('layouts.app') @section('title', 'Locker Details') @section('no-page-header') @section('content')

Locker {{ $locker->locker_number }}

{{ ucfirst($locker->locker_type) }} • {{ ucfirst($locker->locker_size) }}

@php $backUrl = url()->previous(); // Fallback to last visited page @endphp BACK
@php $statusColors = [ 'available' => 'bg-green-100 text-green-800 border border-green-200', 'occupied' => 'bg-blue-100 text-blue-800 border border-blue-200', 'maintenance' => 'bg-yellow-100 text-yellow-800 border border-yellow-200', 'reserved' => 'bg-purple-100 text-purple-800 border border-purple-200' ]; $statusClass = $statusColors[strtolower($locker->status)] ?? 'bg-gray-100 text-gray-800 border border-gray-200'; $dotColors = [ 'available' => 'bg-green-400', 'occupied' => 'bg-blue-400', 'maintenance' => 'bg-yellow-400', 'reserved' => 'bg-purple-400' ]; $dotClass = $dotColors[strtolower($locker->status)] ?? 'bg-gray-400'; @endphp {{ ucfirst($locker->status) }}

Details

Number: {{ $locker->locker_number }}
Type: {{ ucfirst($locker->locker_type) }}
Size: {{ ucfirst($locker->locker_size) }}
Status:
@php $statusColors = [ 'available' => 'bg-green-100 text-green-800 border border-green-200', 'occupied' => 'bg-blue-100 text-blue-800 border border-blue-200', 'maintenance' => 'bg-yellow-100 text-yellow-800 border border-yellow-200', 'reserved' => 'bg-purple-100 text-purple-800 border border-purple-200' ]; $statusClass = $statusColors[strtolower($locker->status)] ?? 'bg-gray-100 text-gray-800 border border-gray-200'; @endphp {{ ucfirst($locker->status) }}

Customer

@if($locker->lockerRegistrationItems->isNotEmpty()) @php $anyRegistration = $locker->lockerRegistrationItems() ->with('client') ->orderBy('created_at', 'desc') ->first(); @endphp @if($anyRegistration && $anyRegistration->client)
{{ $anyRegistration->client->name }}
@if($anyRegistration->client->email)
{{ $anyRegistration->client->email }}
@endif @if($anyRegistration->client->phone)
{{ $anyRegistration->client->phone }}
@endif @if($anyRegistration->status)
{{ $anyRegistration->status }}
@endif
@else
No registration found
@endif @elseif($locker->customer)
{{ $locker->customer->name }}
@if($locker->customer->email)
{{ $locker->customer->email }}
@endif @if($locker->customer->phone)
{{ $locker->customer->phone }}
@endif
@else
No customer assigned
@endif
@if($locker->lockerRegistrationItems->count() > 0)

Registration History

@foreach($locker->lockerRegistrationItems as $registration) @endforeach
Customer Start Date End Date Status Actions
@if($registration->registration && $registration->registration->client) {{ $registration->registration->client->name }} @elseif($registration->customer) {{ $registration->customer->name }} @elseif($registration->client) {{ $registration->client->name }} @else N/A @endif {{ $registration->start_date->format('d,M Y') }} {{ $registration->end_date?->format('d,M Y') ?? 'Ongoing' }} {{ $registration->status }} View
@endif
@if($locker->status === 'available') @endif @endsection @push('scripts') @endpush