@php $rastreamentos = $rastreamentos ?? collect(); $rastreamento = $rastreamento ?? null; if (!function_exists('getStatusInfoRastreamentoCard')) { function getStatusInfoRastreamentoCard($status) { $m = [ 'Coleta Agendada' => ['title' => 'Coleta Agendada', 'icon' => 'fas fa-calendar-check', 'iconBg' => 'bg-info', 'badge' => 'bg-info', 'timelineClass' => 'ativo'], 'Coleta Realizada' => ['title' => 'Coleta Realizada', 'icon' => 'fas fa-box-open', 'iconBg' => 'bg-success', 'badge' => 'bg-success', 'timelineClass' => 'completo'], 'Em Trânsito' => ['title' => 'Em Trânsito', 'icon' => 'fas fa-route', 'iconBg' => 'bg-warning', 'badge' => 'bg-warning', 'timelineClass' => 'pendente'], 'Em Entrega' => ['title' => 'Em Entrega', 'icon' => 'fas fa-truck', 'iconBg' => 'bg-info', 'badge' => 'bg-info', 'timelineClass' => 'pendente'], 'Entregue' => ['title' => 'Entrega Realizada', 'icon' => 'fas fa-handshake', 'iconBg' => 'bg-success', 'badge' => 'bg-success', 'timelineClass' => 'completo'], 'Atrasado' => ['title' => 'Entrega Atrasada', 'icon' => 'fas fa-clock', 'iconBg' => 'bg-danger', 'badge' => 'bg-danger', 'timelineClass' => 'pendente'], 'Problema na Entrega' => ['title' => 'Problema na Entrega', 'icon' => 'fas fa-exclamation-triangle', 'iconBg' => 'bg-warning', 'badge' => 'bg-warning', 'timelineClass' => 'pendente'], ]; return $m[$status ?? ''] ?? ['title' => $status ?? 'Status Desconhecido', 'icon' => 'fas fa-question-circle', 'iconBg' => 'bg-secondary', 'badge' => 'bg-secondary', 'timelineClass' => 'pendente']; } } @endphp
@if($rastreamento) @else @endif
@if($rastreamentos->count() === 0)
Nenhum rastreamento ainda

O histórico da entrega aparecerá aqui após você criar o rastreamento e adicionar atualizações.

@if(empty($rastreamento))

Use o botão Criar Rastreamento acima para começar.

@endif
@else @foreach($rastreamentos as $index => $item) @php $statusInfo = getStatusInfoRastreamentoCard($item->status_atual); $dataAtualizacao = ($item->created_at ?? $item->updated_at) ? \Carbon\Carbon::parse($item->created_at ?? $item->updated_at)->format('d/m/Y - H:i') : '--'; @endphp
{{ $statusInfo['title'] }}

{{ $item->observacao ?? '' }}

Atualizado em: {{ $dataAtualizacao }}
Atualizado por: {{ $item->nome_colaborador ?? 'N/A' }}
{{ $item->status_atual }}
@endforeach @endif