@php $colorFor = function ($status) { return match ($status) { 'success' => 'green', 'partial' => 'yellow', 'expired' => '#888', 'skipped_past' => '#888', 'none' => '#666', default => 'red', }; }; $detailColor = function ($status) { return match ($status) { 'success' => 'green', 'failed' => 'red', 'expired', 'skipped_past' => '#888', default => 'orange', }; }; $scienerStatus = $booking['status'] ?? 'failed'; $scienerColor = $colorFor($scienerStatus); $scienerDetails = $booking['status_details'] ?? []; $unifiStatus = $booking['unifi_status'] ?? 'none'; $unifiColor = $colorFor($unifiStatus); $unifiDetails = $booking['unifi_status_details'] ?? []; @endphp
circle
Status @forelse($scienerDetails as $detail)
circle {{ $detail['lock'] }}: {{ $detail['status'] }}
@empty
No data
@endforelse
@if($unifiStatus !== 'none')
U circle
Unifi Access @forelse($unifiDetails as $detail)
circle {{ $detail['lock'] }}: {{ $detail['status'] }}
@if(!empty($detail['note']))
{{ $detail['note'] }}
@endif @empty
No data
@endforelse
@endif