@extends('admin.layouts.app')
@section('title', 'Dashboard - Admin')
@section('page-title', 'Dashboard')
@section('content')
{{-- Stat Cards --}}
{{-- 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
| User |
Total |
Status |
Date |
@foreach($recentOrders as $order)
| {{ $order->user->name }} |
RM {{ number_format($order->total, 2) }} |
{{ $order->status }} |
{{ $order->created_at->format('d M Y') }} |
@endforeach
@endif
{{-- Quick Actions --}}