@forelse($bookings as $booking) @foreach($booking->items as $item) @if(!$item->related_item) @if($item->vendor_id) @endif {{ $item->booking_id ?? 'N/A' }} @if($item->user_timing) @endif @if($booking->delay || $item->damage) @endif {{ $booking->userDetails->first_name . ' ' . $booking->userDetails->last_name ?? 'N/A' }} {{ preg_replace('/^(\+\d{0,2})(\d+)/', '$1 $2', $booking->userDetails->phone) ?? 'N/A' }} {{$booking->userDetails->email}} {{ $activityCounts[$booking->id] ?? 0 }} @php $reasons = \App\Models\ActivityLog::where('action', 'appointment_change') ->where('description', 'like', '%booking #' . $booking->id . '%') ->orderByDesc('created_at') ->pluck('details'); @endphp @if ($reasons->isNotEmpty()) {!! $reasons->map(fn($r) => e($r))->implode(' / ') !!} @else - @endif {{ $item->pickup_date ? \Carbon\Carbon::parse($item->pickup_date)->format('d.m.Y') : '-' }} / {{ $item->pickup_time ? \Carbon\Carbon::parse($item->pickup_time)->format('H:i') : '-' }} {{ $item->dropoff_date ? \Carbon\Carbon::parse($item->dropoff_date)->format('d.m.Y') : '-' }} / {{ $item->dropoff_time ? \Carbon\Carbon::parse($item->dropoff_time)->format('H:i') : '-' }} {{ $item->new_dropoff_date ? \Carbon\Carbon::parse($item->new_dropoff_date)->format('d.m.Y') : '-' }} / {{ $item->new_dropoff_time ? \Carbon\Carbon::parse($item->new_dropoff_time)->format('H:i') : '-' }}
{{-- --}}
@endif @endforeach @empty No bookings found for selected date @endforelse