@php
$homePending = $statusCounts['pending'] ?? 0;
$homeConfirmed = $confirmedTotal ?? 0;
$homeEnRoute = $statusCounts['en_route'] ?? 0;
$homeDelivered = $statusCounts['delivered'] ?? 0;
@endphp
Solicitar repartidor
Rider urgente
Solicitar rider
{{ $restaurant?->zone?->name ?? 'Zona activa' }}
Pendientes
{{ $homePending }}
Confirmados
{{ $homeConfirmed }}
En camino
{{ $homeEnRoute }}
Entregados
{{ $homeDelivered }}
@php
$last = $latestDelivery ?? (($allDeliveries ?? collect())->first());
$lastLabel = $last ? ($statusMap[$last->status][0] ?? 'Pendiente') : 'Sin estado';
$lastBadge = $last ? ($statusMap[$last->status][1] ?? 'secondary') : 'secondary';
$hasCourier = $last && $last->courier;
$courierLine = $hasCourier ? ($last->courier->name ?? 'Repartidor asignado') : 'Sin repartidor';
$courierStatus = match ($last?->status) {
'pending' => 'Aún no viene en camino (buscando rider)',
'confirmed' => 'Rider asignado, pendiente de recogida',
'at_restaurant' => 'Rider en restaurante (recogiendo pedido)',
'en_route' => 'Rider en camino al cliente',
'delivered' => 'Pedido entregado',
'cancelled' => 'Pedido cancelado',
default => $hasCourier ? 'Rider asignado' : 'Sin asignar',
};
$lastProgress = match ($last?->status) {
'pending' => 18,
'confirmed' => 46,
'at_restaurant' => 62,
'en_route' => 84,
'delivered' => 100,
'cancelled' => 100,
default => 12,
};
$lastProgressText = match ($last?->status) {
'pending' => 'Buscando rider disponible',
'confirmed' => 'Rider asignado',
'at_restaurant' => 'Rider en restaurante',
'en_route' => 'Rider en camino al cliente',
'delivered' => 'Entrega completada',
'cancelled' => 'Pedido cancelado',
default => 'Sin estado',
};
@endphp
Último pedido
Seguimiento rápido y acceso en un toque.
Ver órdenes
{{ $lastLabel }}
{{ $last ? "#{$last->id}" : '--' }}
{{ $last ? optional($last->created_at)->format('H:i') : '--:--' }}
Urgente
Cliente
{{ $last?->customer_name ?? 'Por definir' }}
{{ $last?->customer_phone ?: 'Sin teléfono' }}
{{ $last?->delivery_address ?? 'Por definir' }}
Rider
{{ $courierLine }}
{{ $courierStatus }}
Toca para centrar esta orden
Aún no has solicitado ningún servicio hoy.
Crear primera orden
Pendiente
{{ $statusCounts['pending'] }} pedidos
Confirmado
{{ $confirmedTotal }} pedidos
En camino
{{ $statusCounts['en_route'] }} pedidos
Entregado
{{ $statusCounts['delivered'] }} pedidos
@forelse ($allDeliveries ?? collect() as $delivery)
@php
$mobileStatus = $statusMap[$delivery->status] ?? ['Pendiente', 'secondary', 20];
$mobileStatusLabel = $mobileStatus[0];
$mobileStatusColor = $mobileStatus[1];
$mobileCustomer = $delivery->customer_name ?: 'Cliente sin nombre';
$mobileAddress = $delivery->delivery_address ?: 'Dirección sin definir';
@endphp
#{{ $delivery->id }}
{{ $mobileCustomer }}
{{ $mobileStatusLabel }}
{{ $mobileAddress }}
@empty
No hay pedidos hoy.
@endforelse
{{ strtoupper(substr($restaurant?->name ?? 'R', 0, 1)) }}
{{ $restaurant?->name ?? 'Restaurante' }}
{{ $restaurant?->address ?? 'Sin dirección' }}
{{ $restaurant?->zone?->name ?? 'Zona no asignada' }}
Pendientes
{{ $statusCounts['pending'] ?? 0 }}
Confirmados
{{ $confirmedTotal }}
En camino
{{ $statusCounts['en_route'] ?? 0 }}
Entregados
{{ $statusCounts['delivered'] ?? 0 }}
Versión completa