@extends('admin.layouts.app') @section('title', 'Dashboard') @section('content')
@php $cards = [ ['label' => "Today's Sales", 'value' => $siteSettings['currency'].number_format($stats['today_sales'],2), 'icon' => 'fa-sack-dollar'], ['label' => 'Monthly Sales', 'value' => $siteSettings['currency'].number_format($stats['monthly_sales'],2), 'icon' => 'fa-chart-line'], ['label' => 'Total Products', 'value' => $stats['total_products'], 'icon' => 'fa-bowl-food'], ['label' => 'Low Stock', 'value' => $stats['low_stock'], 'icon' => 'fa-triangle-exclamation'], ['label' => 'Out of Stock', 'value' => $stats['out_of_stock'], 'icon' => 'fa-ban'], ['label' => 'Active Offers', 'value' => $stats['active_offers'], 'icon' => 'fa-percent'], ['label' => 'Active Promo Codes', 'value' => $stats['active_promo_codes'], 'icon' => 'fa-ticket'], ['label' => 'Est. Profit (mo.)', 'value' => $siteSettings['currency'].number_format($stats['estimated_profit'],2), 'icon' => 'fa-piggy-bank'], ]; @endphp @foreach($cards as $c)
{{ $c['value'] }}
{{ $c['label'] }}
@endforeach

Sales — Last 7 Days

Low Stock Alert

@forelse($lowStockProducts as $p)
{{ $p->name }} {{ $p->stock_quantity }} left
@empty

All products are well stocked.

@endforelse

Recent Products

@foreach($recentProducts as $p)
{{ $p->name }} {{ $p->created_at->diffForHumans() }}
@endforeach

Recent Stock Changes

@foreach($recentStock as $s)
{{ $s->product->name ?? '—' }} {{ $s->quantity_changed >= 0 ? '+' : '' }}{{ $s->quantity_changed }}
@endforeach
@endsection @push('scripts') @endpush