@extends('layouts.admin') @section('title', 'Dashboard') @section('content') {{-- Welcome banner --}}

Welcome back, {{ explode(' ', auth()->user()->name ?? 'there')[0] }}! ๐Ÿ‘‹

Here's what's happening at {{ auth()->user()->client->brand_name ?? 'your restaurant' }} today.

๐Ÿ—“๏ธ {{ now()->format('l, d F Y') }} System Online
๐Ÿ“ˆ
{{-- Stat cards --}}
@foreach ([ ['Today\'s Orders', $todaysOrders, 'Today', '๐Ÿงพ'], ['Today\'s Revenue', 'โ‚น'.number_format($todaysRevenue, 2), 'Today', '๐Ÿ’ฐ'], ['Avg. Order Value', 'โ‚น'.number_format($avgOrderValue, 2), 'Per order', '๐Ÿ“Š'], ['Low Stock Items', $lowStockItems, $lowStockItems > 0 ? 'Needs restock' : 'All good', '๐Ÿ“ฆ'], ] as [$label, $value, $caption, $icon])

{{ $label }}

{{ $value }}

{{ $caption }}

{{ $icon }}
@endforeach
{{-- Sales chart + top products --}}

Sales by Hour (Today)

Top Products Today

@forelse ($topProducts as $p)
{{ $p->name }} {{ $p->qty_sold }} sold
@empty

No sales yet today.

@endforelse
{{-- Quick actions --}}

โšก Quick Actions

@foreach ([ ['Add Staff', 'admin.staff.index', '๐Ÿ‘ค', 'from-red-600 to-red-700'], ['View Orders', 'admin.orders.index', '๐Ÿ“‹', 'from-zinc-800 to-zinc-900'], ['Manage Products', 'admin.products.index', '๐Ÿ“ฆ', 'from-violet-600 to-violet-700'], ['View Reports', 'admin.reports.index', '๐Ÿ“„', 'from-emerald-600 to-emerald-700'], ] as [$label, $route, $icon, $gradient]) โ†’ {{ $icon }} {{ $label }} @endforeach

Recent Orders

View all
@foreach ($recentOrders as $order) @endforeach
Order # Source / Staff Table Items Total Status Time
{{ $order->order_number }} {{ $order->source === 'mobile' ? 'Mobile / '.($order->placedByStaff->name ?? 'Staff') : 'Kiosk / '.($order->cashier->name ?? 'โ€”') }} {{ $order->restaurantTable->name ?? 'โ€”' }} {{ $order->items->sum('qty') }} โ‚น{{ number_format($order->grand_total, 2) }} {{ \App\Models\Order::STATUS_LABELS[$order->status] ?? $order->status }} {{ $order->created_at->format('h:i A') }}
@endsection