@include('Admin.Includes.header')
{{-- new --}}

Revenue

{{ $all_orders }}

Orders

${{ number_format(array_sum($chartData['orderSales']) + array_sum($chartData['posSales']), 0, '.', ',') }}

Earnings

{{ $refundOrder }}

Refunds

{{ number_format(($comp_orders / ($all_orders > 0 ? $all_orders : 1)) * 100, 2) }}%

Conversion Ratio

Reached {{ $total_users }} Customers

Want to see your top selling products? Check out the detailed statistics!

Manage your {{ $total_products }} Products

Create new products or update existing ones in your online store.

Top Selling Products

View All
@foreach ($topSellingProducts as $product) @endforeach
Product Orders Quantity Sold Actions
@php $imagePath = $product->featured_image; $imageExists = $imagePath && file_exists( public_path( parse_url(asset($imagePath), PHP_URL_PATH), ), ); $firstLetter = strtoupper( Str::substr($product->title ?? 'P', 0, 1), ); @endphp
@if ($imageExists) {{ $product->title }} @else
{{ $firstLetter }}
@endif
{{ $product->title }}
{{ $product->order_count }} {{ $product->total_quantity }} View
@foreach ($topSellingProducts as $product) @endforeach
Top Sales Locations

${{ number_format($totalLocationSales) }} Total Sales

{{ $currentYear }}

Sales by Location - {{ $currentYear }}

@foreach (array_slice($locationData, 0, 14) as $index => $location) @endforeach
{{ $location['city'] }}
{{ $location['state'] }}
${{ number_format($location['sales']) }} {{ $location['orders'] }} orders
@php $percentColors = [ 'success', 'info', 'primary', 'warning', 'danger', 'secondary', ]; $percent = round( ($location['sales'] / $totalLocationSales) * 100, ); @endphp {{ $percent }}%

Order Statistics

Total Orders {{ $all_orders }}
Completed Orders {{ $comp_orders }}
Pending Orders {{ $pend_orders }}
In-Process Orders {{ $inpro_orders }}
Cancelled Orders {{ $canc_orders }}
Online Orders {{ $online_orders }}
Invoice Orders {{ $invoice_orders }}

Sales Analytics

Recent Orders

@foreach ($orders as $order) @endforeach
Order ID Customer Name Amount Order Date Status Action
{{ $order->id }}
{{ strtoupper(substr($order->f_name, 0, 1)) }}
{{ trim($order->f_name . ' ' . $order->l_name) ?: '' }}
${{ $order->total_amount }} {{ $order->created_at->format('d M, Y') }} @if ($order->status == 'completed') Completed @elseif($order->status == 'pending') Pending @elseif($order->status == 'inProcess') In Process @elseif($order->status == 'cancelled') Cancelled @else {{ $order->status }} @endif View
{{-- {{ route('admin.orders.index') }} --}} View All Orders
@foreach ($orders as $order) @endforeach
Product Delivery
View All
@foreach ($orders->take(10) as $order)
@php $orderMeta = $order->orderMeta->first(); $product = $orderMeta ? $orderMeta->product : null; $imagePath = $product?->featured_image; $imageExists = $imagePath && file_exists( public_path( parse_url(asset($imagePath), PHP_URL_PATH), ), ); $firstLetter = strtoupper( Str::substr($product->title ?? 'P', 0, 1), ); // Fallback letter: 'P' @endphp
@if ($imageExists) Product Image @else
{{ $firstLetter }}
@endif
{{ $orderMeta && $orderMeta->product ? Str::limit($orderMeta->product->title, 30) : 'Product' }}

by: {{ $order->user ? $order->user->name : 'Customer' }}

@php $statusMap = [ 'pending' => [ 'bg-warning-subtle text-warning', 'fa-solid fa-arrows-rotate', ], 'completed' => [ 'bg-success-subtle text-success', 'fa-solid fa-list', ], 'cancelled' => [ 'bg-danger-subtle text-danger', 'fa-solid fa-ban', ], 'inProcess' => [ 'bg-info-subtle text-info', 'fa-solid fa-hourglass-start', ], ]; $status = strtolower($order->status); $badgeClass = $statusMap[$status][0] ?? 'bg-secondary-subtle text-secondary'; $iconClass = $statusMap[$status][1] ?? 'bi-question-circle'; @endphp {{ ucfirst($order->status) }}
Invoice {{ $order->invoice_number }}
Amount ${{ number_format($order->total_amount, 2) }}
Payment Status {{ ucfirst($order->payment_status) }}
Payment Method {{ ucfirst($order->payment_method) }}
Shipping Address {{ $order->street_address }}, {{ $order->city }}, {{ $order->state }} {{ $order->post_code }}
@endforeach

Least Selling Products

@foreach ($leastSellingProducts as $product) @php $imageExists = $product->featured_image && file_exists( public_path( parse_url( asset($product->featured_image), PHP_URL_PATH, ), ), ); $firstLetter = strtoupper(Str::substr($product->title, 0, 1)); @endphp @endforeach
Product Orders Quantity Action
@if ($imageExists) {{ $product->title }} @else
{{ $firstLetter }}
@endif
{{ Str::limit($product->title, 30) }}
{{ $product->order_count }} {{ $product->total_quantity ?? 0 }} View

Recent Customers

@foreach ($customers as $customer) @endforeach
Customer Email Created At Action
{{ strtoupper(substr($customer->name, 0, 1)) }}
{{ $customer->name }}
{{ $customer->email }} {{ $customer->created_at->format('d M, Y') }}