@extends('layouts.app') @section('title', 'Dashboard') @section('content')
Here's what's happening with your stores today.
Total Stores
{{ Auth::user()->stores ? Auth::user()->stores->count() : 0 }}
Active Orders
@php $activeOrders = 0; if (Auth::user()->stores && Auth::user()->stores->count() > 0) { $activeOrders = Auth::user()->stores->sum(function($store) { return $store->orders()->whereIn('status', ['pending', 'processing'])->count(); }); } @endphp {{ $activeOrders }}
Total Revenue
@php $totalRevenue = 0; if (Auth::user()->stores && Auth::user()->stores->count() > 0) { $totalRevenue = Auth::user()->stores->sum(function($store) { return $store->orders()->whereIn('status', ['completed', 'shipped'])->sum('total_amount'); }); } @endphp ${{ number_format($totalRevenue, 2) }}
Pending Orders
@php $pendingOrders = 0; if (Auth::user()->stores && Auth::user()->stores->count() > 0) { $pendingOrders = Auth::user()->stores->sum(function($store) { return $store->orders()->where('status', 'pending')->count(); }); } @endphp {{ $pendingOrders }}
Create a new store location
View and edit your stores
Manage all your orders
| Order ID | Store | Customer | Amount | Status | Date |
|---|---|---|---|---|---|
| #{{ $order->id }} | {{ $order->store?->name ?? 'N/A' }} | {{ $order->customer_name }} | ${{ number_format($order->total_amount, 2) }} | {{ ucfirst($order->status) }} | {{ $order->created_at->format('M d, Y') }} |
Get started by creating your first store.