@extends('admin.layouts.app') @section('page-title', 'Dashboard') @php use App\Models\Order; use App\Models\OrderItem; use App\Models\Shipment; use App\Models\Invoice; use App\Models\User; use App\Models\Admin; $totalOrders = Order::count(); $pendingOrders = Order::where('status', 'pending')->count(); $totalShipments = Shipment::count(); $totalItems = OrderItem::count(); $totalRevenue = Invoice::sum('final_amount_with_gst'); // USERS (CUSTOMERS) $activeCustomers = User::where('status', 'active')->count(); $inactiveCustomers = User::where('status', 'inactive')->count(); // STAFF (FROM ADMINS TABLE) $totalStaff = Admin::where('type', 'staff')->count(); $orders = Order::latest()->get(); @endphp @section('content')
Admin Dashboard
Monitor operations and manage system
📦
Total Shipments
{{ $totalShipments }}
👥
Active Customers
{{ $activeCustomers }}
💰
Total Revenue
₹{{ number_format($totalRevenue, 2) }}
Pending Order
{{ $pendingOrders }}
📦
Total Orders
{{ $totalOrders }}
🧑‍💼
Total Staff
{{ $totalStaff }}
📦
Total Items
{{ $totalItems }}
Inactive Customers
{{ $inactiveCustomers }}
Order Management @can('order.create') @endcan
Recent Orders Total orders: {{ $orders->count() }}
@forelse($orders as $order) @empty @endforelse
# Order ID Mark No Origin Destination Total CTN Total QTY Total TTL/QTY Total Amount (₹) Total CBM Total TTL CBM Total KG Total TTL KG Status Date Actions
{{ $order->id }} {{ $order->order_id }} {{ $order->mark_no }} {{ $order->origin }} {{ $order->destination }} {{ $order->ctn }} {{ $order->qty }} {{ $order->ttl_qty }} ₹{{ number_format($order->ttl_amount, 2) }} {{ $order->cbm }} {{ $order->ttl_cbm }} {{ $order->kg }} {{ $order->ttl_kg }} @php // Badge color mapping $badgeMap = [ 'order_placed' => 'secondary', 'order_confirmed' => 'info', 'supplier_warehouse' => 'warning', 'consolidate_warehouse' => 'warning', 'export_custom' => 'primary', 'international_transit' => 'primary', 'arrived_india' => 'info', 'import_custom' => 'info', 'warehouse' => 'dark', 'domestic_distribution' => 'primary', 'out_for_delivery' => 'success', 'delivered' => 'success', ]; // Icon mapping $iconMap = [ 'order_placed' => 'bi-clock-fill', 'order_confirmed' => 'bi-check-circle', 'supplier_warehouse' => 'bi-box-seam', 'consolidate_warehouse' => 'bi-boxes', 'export_custom' => 'bi-upload', 'international_transit' => 'bi-truck', 'arrived_india' => 'bi-geo-alt', 'import_custom' => 'bi-download', 'warehouse' => 'bi-building', 'domestic_distribution' => 'bi-diagram-3', 'out_for_delivery' => 'bi-truck-flatbed', 'delivered' => 'bi-check-circle-fill', ]; $badgeClass = $badgeMap[$order->status] ?? 'secondary'; $iconClass = $iconMap[$order->status] ?? 'bi-info-circle'; @endphp {{ $order->status_label }} {{ $order->created_at->format('d-m-Y') }} View
No orders found
Showing 1 to 10 of {{ $orders->count() }} entries
@endsection