@extends('admin.layouts.app') @section('title', 'Dashboard') @section('content')
@php $cards = [ ['label' => 'Total Orders', 'value' => number_format($stats['orders_total']), 'icon' => 'bi-receipt', 'bg' => 'primary'], ['label' => 'Pending Orders', 'value' => number_format($stats['orders_pending']), 'icon' => 'bi-hourglass-split', 'bg' => 'warning'], ['label' => 'Revenue (delivered)', 'value' => money($stats['revenue']), 'icon' => 'bi-cash-stack', 'bg' => 'success'], ['label' => 'Profit (delivered)', 'value' => money($stats['profit']), 'icon' => 'bi-graph-up-arrow', 'bg' => 'info'], ]; @endphp @foreach($cards as $c)
{{ $c['value'] }}
{{ $c['label'] }}
@endforeach
{{ $stats['customers'] }}
Customers
{{ $stats['products'] }}
Products
{{ $stats['low_stock'] }}
Low Stock
{{ $stats['out_of_stock'] }}
Out of Stock
Sales — last 14 days
Low Stock Alert
@forelse($lowStockProducts as $p) {{ $p->name }} {{ $p->stock_qty }} @empty
All good — no low stock.
@endforelse
Recent Orders View all
@forelse($recentOrders as $o) @empty @endforelse
OrderCustomerTotalPaymentStatusDate
{{ $o->order_number }} {{ $o->customer_name }}
{{ $o->customer_phone }}
{{ money($o->total) }} {{ $o->payment_method }} {{ $o->statusLabel() }} {{ $o->created_at->format('d M, H:i') }}
No orders yet.
@endsection @push('scripts') @endpush