@extends('admin.layouts.app') @section('title', 'Dashboard - Admin') @section('page-title', 'Dashboard') @section('content') {{-- Stat Cards --}}
๐Ÿ“ฆ
Total Products
{{ $totalProducts }}
{{ $lowStock }} low stock
๐Ÿท๏ธ
Categories
{{ $totalCategories }}
๐Ÿ‘ฅ
Total Users
{{ $totalUsers }}
๐Ÿ’ฐ
Total Revenue
RM {{ number_format($totalRevenue, 2) }}
{{ $totalOrders }} orders
{{-- Alert Popup Modal --}} @if($expired > 0 || $expiringSoon > 0 || $lowStock > 0)
{{-- Header --}}
โš ๏ธ
Action Required
Please review the following alerts
{{-- Alert Items --}}
@if($expired > 0)
๐Ÿšจ
{{ $expired }} product(s) EXPIRED
Remove or replace these items immediately
@endif @if($expiringSoon > 0)
๐Ÿ•
{{ $expiringSoon }} product(s) expiring within 7 days
Check inventory and plan promotions
@endif @if($lowStock > 0)
๐Ÿ“‰
{{ $lowStock }} product(s) low stock (โ‰ค 3)
Restock soon to avoid running out
@endif
{{-- Actions --}}
๐Ÿ—„๏ธ View Inventory
@endif
{{-- Monthly Sales Chart --}}
๐Ÿ“ˆ Monthly Sales ({{ now()->year }})
@php // Sediakan susunan data bulan 1-12 $salesData = array_fill(1, 12, 0); foreach ($monthlySales as $sale) { $salesData[(int)$sale->month] = (float)$sale->total; } @endphp {{-- Kawasan Graf (Canvas) --}}
{{-- Sila pastikan CDN Chart.js ini diletakkan, atau pastikan ia dipanggil di layout app anda --}} {{-- Recent Orders --}}
๐Ÿงพ Recent Orders
@if($recentOrders->isEmpty())

No orders yet.

@else @foreach($recentOrders as $order) @endforeach
User Total Status Date
{{ $order->user->name }} RM {{ number_format($order->total, 2) }} {{ $order->status }} {{ $order->created_at->format('d M Y') }}
@endif
{{-- Quick Actions --}}
โšก Quick Actions
+ Add Product + Add Category ๐Ÿ—„๏ธ Inventory ๐Ÿ’ฐ Revenue Report ๐Ÿ‘ฅ View Users
@endsection @push('scripts') @endpush