@extends('layouts.app') @section('title', 'Warehouse Dashboard') @push('styles') @endpush @section('content')

📊 Warehouse Dashboard

Welcome back, {{ Auth::guard('wuser')->user()->name }}! Here's what's happening today.

Current Time
Pending Shipments

{{ $data['pending_shipments'] ?? 0 }}

Processed Today

{{ $data['processed_today'] ?? 0 }}

In Transit

{{ $data['in_transit_shipments'] ?? 0 }}

Delivered

{{ $data['delivered_shipments'] ?? 0 }}

Shipment Status Distribution
Monthly Status Distribution - {{ \Carbon\Carbon::now()->format('F Y') }}
Monthly Shipments (All Months)
Tracking Status Distribution
📦 Recent Activity
View All
@forelse(collect($data['recent_shipments'] ?? [])->take(5) as $shipment) @php $initials = strtoupper(substr($shipment['customer_name'], 0, 2)); $colors = [ ['#E57373', '#EF5350'], ['#10b981', '#059669'], ['#3b82f6', '#2563eb'], ['#f59e0b', '#d97706'], ['#8b5cf6', '#7c3aed'], ]; $colorIndex = crc32($shipment['customer_name']) % count($colors); // Map display_status to badge class $displayStatus = $shipment['display_status'] ?? 'N/A'; $statusClassMap = [ 'Delivered' => ['label' => 'Delivered', 'class' => 'status-processed'], 'In Transit' => ['label' => 'In Transit', 'class' => 'status-transit'], 'Out for Delivery' => ['label' => 'Out for Delivery', 'class' => 'status-transit'], 'Processed' => ['label' => 'Processed', 'class' => 'status-processed'], 'Processing' => ['label' => 'Processing', 'class' => 'status-pending'], 'Package Received' => ['label' => 'Package Received', 'class' => 'status-pending'], ]; $statusInfo = $statusClassMap[$displayStatus] ?? ['label' => $displayStatus, 'class' => 'status-pending']; @endphp @empty @endforelse
Tracking # Customer Status Date Actions
{{ $shipment['tracking_number'] }}
{{ $initials }}
{{ $shipment['customer_name'] }}
{{ $shipment['customer_email'] }}
{{ $statusInfo['label'] }} {{ $shipment['created_at'] }} @php $paymentId = $shipment['payment_id'] ?? null; if (!$paymentId && !empty($shipment['tracking_number'])) { $paymentId = \App\Models\ShipmentPayment::where('tracking_number', $shipment['tracking_number'])->value('id'); } @endphp @if($paymentId) View @else N/A @endif
No recent shipments found.
@push('scripts') @endpush @endsection