@extends('admin.layouts.app') @section('title', __('admin.menu.dashboard')) @section('page-title', __('admin.dashboard.welcome')) @section('page-subtitle', __('admin.auth.welcome', ['name' => auth()->user()->name])) @php $cards = [ ['key' => 'customers', 'icon' => 'bi-people', 'variant' => 'primary', 'route' => 'admin.customers.index'], ['key' => 'orders', 'icon' => 'bi-bag-check', 'variant' => 'success', 'route' => 'admin.orders.index'], ['key' => 'revenue', 'icon' => 'bi-cash-coin', 'variant' => 'warning', 'route' => null, 'money' => true], ['key' => 'products', 'icon' => 'bi-box-seam', 'variant' => 'info', 'route' => 'admin.products.index'], ['key' => 'quote_requests', 'icon' => 'bi-file-earmark-text', 'variant' => 'secondary', 'route' => 'admin.quote-requests.index'], ['key' => 'trade_requests', 'icon' => 'bi-truck', 'variant' => 'primary', 'route' => 'admin.trade-requests.index'], ['key' => 'rental_bookings', 'icon' => 'bi-calendar-check', 'variant' => 'success', 'route' => 'admin.rental-bookings.index'], ['key' => 'appointments', 'icon' => 'bi-calendar2-week', 'variant' => 'danger', 'route' => 'admin.appointments.index'], ]; @endphp @section('content')
@foreach ($cards as $card)
{{ __('admin.dashboard.'.$card['key']) }}
@if ($card['money'] ?? false) {{ number_format($stats[$card['key']], 0) }} {{ config('shop.currency') }} @else {{ number_format($stats[$card['key']]) }} @endif
@if (($pending[$card['key']] ?? 0) > 0) {{ $pending[$card['key']] }} {{ __('admin.dashboard.pending_actions') }} @endif
@endforeach
{{ __('admin.dashboard.orders_chart') }}
{{ __('admin.dashboard.latest_appointments') }}
    @forelse ($latestAppointments as $appointment)
  • {{ $appointment->patient_name }}
    {{ $appointment->doctor?->name }} ยท {{ $appointment->appointment_date?->toDateString() }}
    @include('admin.partials.badge-status', [ 'label' => __('statuses.appointment.'.$appointment->status), 'status' => $appointment->status, ])
  • @empty
  • {{ __('admin.dashboard.no_records') }}
  • @endforelse
{{ __('admin.dashboard.latest_orders') }}
@forelse ($latestOrders as $order) @empty @endforelse
{{ __('admin.fields.reference') }} {{ __('admin.fields.customer') }} {{ __('admin.fields.total') }} {{ __('admin.fields.status') }} {{ __('admin.fields.created_at') }}
{{ $order->reference }} {{ $order->user?->name }} {{ number_format((float) $order->total, 2) }} {{ $order->currency }} @include('admin.partials.badge-status', ['label' => __('statuses.order.'.$order->status), 'status' => $order->status]) {{ $order->created_at->format('Y-m-d H:i') }}
{{ __('admin.dashboard.no_records') }}
@endsection @push('scripts') @endpush