Shop, menu, and booking storefronts with OIDC SSO, Pay checkout, and merchant.ladill.com deployment workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
69 lines
4.4 KiB
PHP
69 lines
4.4 KiB
PHP
<x-user-layout>
|
|
<x-slot name="title">Overview</x-slot>
|
|
@php $fmtMinor = fn ($m) => 'GHS '.number_format($m / 100, 2); @endphp
|
|
<div class="space-y-6">
|
|
<div>
|
|
<h1 class="text-xl font-semibold text-slate-900">Overview</h1>
|
|
<p class="mt-1 text-sm text-slate-500">Sales today, active storefronts, and recent orders.</p>
|
|
</div>
|
|
<div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
<div class="rounded-2xl border border-slate-200 bg-white p-5">
|
|
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Revenue today</p>
|
|
<p class="mt-1.5 text-2xl font-semibold text-slate-900">GHS {{ number_format($todayRevenue, 2) }}</p>
|
|
</div>
|
|
<div class="rounded-2xl border border-slate-200 bg-white p-5">
|
|
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Orders today</p>
|
|
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ number_format($todayCount) }}</p>
|
|
</div>
|
|
<div class="rounded-2xl border border-slate-200 bg-white p-5">
|
|
<p class="text-xs font-medium uppercase tracking-wide text-slate-400">Orders (30d)</p>
|
|
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ number_format($orders30d) }}</p>
|
|
</div>
|
|
<div class="rounded-2xl border border-indigo-100 bg-indigo-50/60 p-5">
|
|
<p class="text-xs font-medium uppercase tracking-wide text-indigo-600">Wallet balance</p>
|
|
<p class="mt-1.5 text-2xl font-semibold text-slate-900">{{ $fmtMinor($balanceMinor) }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="grid gap-4 lg:grid-cols-2">
|
|
<div class="rounded-2xl border border-slate-200 bg-white">
|
|
<div class="flex items-center justify-between border-b border-slate-100 px-6 py-4">
|
|
<h2 class="font-semibold text-slate-900">Recent orders</h2>
|
|
<a href="{{ route('merchant.orders.index') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">View all</a>
|
|
</div>
|
|
@if($recentOrders->isEmpty())
|
|
<p class="px-6 py-8 text-sm text-slate-500">No orders yet. Create a storefront and share your QR.</p>
|
|
@else
|
|
<div class="divide-y divide-slate-100">
|
|
@foreach($recentOrders as $order)
|
|
<div class="flex items-center justify-between px-6 py-4">
|
|
<div>
|
|
<p class="font-medium text-slate-900">{{ $order->customer_name ?: 'Customer' }}</p>
|
|
<p class="text-xs text-slate-500">{{ $order->qrCode?->label }} · {{ $order->paid_at?->diffForHumans() }}</p>
|
|
</div>
|
|
<span class="text-sm font-semibold text-emerald-700">GHS {{ number_format((float) $order->merchant_amount_ghs, 2) }}</span>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<div class="rounded-2xl border border-slate-200 bg-white p-6">
|
|
<h2 class="font-semibold text-slate-900">Quick links</h2>
|
|
<div class="mt-4 space-y-3">
|
|
<a href="{{ route('merchant.storefronts.create') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
|
|
<span class="font-medium text-slate-700">Create storefront</span>
|
|
<span class="text-slate-400">→</span>
|
|
</a>
|
|
<a href="{{ route('merchant.storefronts.index') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
|
|
<span class="font-medium text-slate-700">All storefronts</span>
|
|
<span class="text-slate-400">→</span>
|
|
</a>
|
|
<a href="{{ route('merchant.payouts') }}" class="flex items-center justify-between rounded-xl border border-slate-100 px-4 py-3 text-sm hover:bg-slate-50">
|
|
<span class="font-medium text-slate-700">Payouts & wallet</span>
|
|
<span class="text-slate-400">→</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</x-user-layout>
|