@extends('layouts.admin') @section('title', __('Dashboard')) @section('content') @php $m = $shop->money; @endphp

{{ __('Dashboard') }}

@foreach ([ [__('Orders today'), $d['orders_today'], route('admin.orders')], [__('Waiting to confirm'), $d['pending'], route('admin.orders', ['status' => 'pending'])], [__('To pack / ship'), $d['to_ship'], route('admin.orders')], [__('Sales, last 30 days'), $m->format($d['revenue_30d']), null], [__('Active products'), $d['products'], auth()->user()->isAdmin() ? route('admin.products') : null], [__('Customers'), $d['customers'], auth()->user()->isAdmin() ? route('admin.customers') : null], ] as [$label, $value, $href])

{{ $label }}

{{ $value }}

@if ($href)@endif
@endforeach
@if ($d['products'] === 0 && auth()->user()->isAdmin())

{{ __('Your shop is empty — let\'s add products.') }}

  1. {{ __('Add colours and sizes') }}
  2. {{ __('Create a category') }}
  3. {{ __('Add your first product') }}
@endif

{{ __('Recent orders') }}

@forelse ($d['recent_orders'] as $o) {{ $o->order_number }}{{ $o->recipient_name }} {{ $m->format((float) $o->grand_total) }} @empty

{{ __('No orders yet.') }}

@endforelse

{{ __('Low stock') }}

@forelse ($d['low_stock'] as $l)
{{ $l->product }}{{ $l->sku }} {{ $l->available <= 0 ? __('Sold out') : __(':n left', ['n' => $l->available]) }}
@empty

{{ __('Nothing is running low.') }}

@endforelse {{ __('Open stock') }}
@endsection