{{-- resources/views/restaurant/dashboard.blade.php --}} @extends('layouts.restaurant') @section('title', 'Dashboard') @php $currencySymbol = App\Models\AppSetting::getValue('currency_symbol', html_entity_decode('₹', ENT_QUOTES, 'UTF-8')); $currencyDecimals = App\Models\AppSetting::currencyDecimals(); if (str_contains($currencySymbol, '{{') || str_contains($currencySymbol, 'currencySymbol')) { $currencySymbol = html_entity_decode('₹', ENT_QUOTES, 'UTF-8'); } $activeRestaurantCount = $selectedScope === 'all' ? $restaurants->where('is_open', true)->count() : (($restaurant?->is_open ?? false) ? 1 : 0); $restaurantLabel = $selectedScope === 'all' ? 'All Stores' : ($restaurant->name ?? 'Store'); $displayOrders = $activeOrders->isNotEmpty() ? $activeOrders : $recentOrders->take(5); @endphp @section('styles') @endsection @section('content')
Seller overview

{{ $restaurantLabel }}

Manage incoming orders, your catalog, customers, payouts, and store performance.

{{ $currencySymbol }}{{ number_format($todayRevenue, $currencyDecimals) }} today
Total Revenue
{{ $currencySymbol }}{{ number_format($totalRevenue, $currencyDecimals) }}
Delivered revenue
{{ $todayOrders }} today
Total Orders
{{ number_format($totalOrders) }}
{{ number_format($pendingOrders) }} active, {{ number_format($deliveredOrdersCount) }} delivered
Customer base
Total Customers
{{ number_format($totalCustomers) }}
Unique ordering customers
{{ number_format($successRate, 1) }}% success
Average Rating
{{ number_format($avgRating, 1) }}
Customer experience score
{{ $payoutSummary['frequency'] }}
Pending Payouts
{{ $currencySymbol }}{{ number_format($payoutSummary['pending_amount'], $currencyDecimals) }}
{{ $payoutSummary['pending_count'] }} queued

Revenue Trend

Delivered orders and revenue across the last 14 days.

Live Orders

View All
@forelse($displayOrders as $order) @php $statusClass = str_replace('_', '-', strtolower($order->status ?? 'pending')); $itemsCount = $order->order_items_count; if (!$itemsCount && is_array($order->items)) { $itemsCount = collect($order->items)->sum(fn ($item) => (int) ($item['quantity'] ?? $item['qty'] ?? 1)); } @endphp
{{ strtoupper(substr($order->customer->name ?? 'G', 0, 1)) }}
#{{ $order->order_number ?? $order->id }}
{{ $order->customer->name ?? 'Guest' }} - {{ $itemsCount }} items
{{ $order->created_at->diffForHumans() }}
{{ $currencySymbol }}{{ number_format($order->total, $currencyDecimals) }}
{{ ucfirst(str_replace('_', ' ', $order->status)) }}
@empty
No orders yet.
@endforelse

Popular Items

@if(auth()->user()->hasRestaurantPermission('manage_menu')) Manage @endif
@forelse($popularItems as $item)
{{ $item->name }}
{{ number_format($item->total_orders ?? 0) }} orders
{{ $currencySymbol }}{{ number_format($item->price, $currencyDecimals) }}
@empty
No popular items yet.
@endforelse

Store Revenue Split

@forelse($restaurantBreakdown as $row)
{{ strtoupper(substr($row['name'], 0, 1)) }}
{{ $row['name'] }}
{{ $currencySymbol }}{{ number_format($row['revenue'], $currencyDecimals) }}
{{ $row['city'] ?: 'Location not set' }} - {{ number_format($row['orders']) }} delivered
@empty
No delivered revenue yet.
@endforelse

Operations Summary

Best Order Time
{{ $bestOrderTime['label'] }}
{{ $bestOrderTime['orders'] }} orders
Success Rate
{{ number_format($successRate, 1) }}%
{{ number_format($deliveredOrdersCount) }} delivered
Cancellation
{{ number_format($cancellationRate, 1) }}%
{{ number_format($cancelledOrders) }} cancelled
Avg Delivery
{{ $avgDeliveryTime ? number_format($avgDeliveryTime) : 0 }} mins
Delivered orders

Payout & Store Health

Store Status
{{ $activeRestaurantCount > 0 ? 'Online' : 'Offline' }}
Next Payout
{{ $payoutSummary['next_date']->format('d M Y') }}
Last Payout
@if($payoutSummary['last']) {{ ucfirst($payoutSummary['last']->status) }} @else None @endif
Pending Queue
{{ $payoutSummary['pending_count'] }} payouts
@endsection @section('scripts') @endsection