@extends('layouts.app') @section('title', 'Vendor Analytics Dashboard') @section('content')
@include('vendor.partials.sidebar-column')

Analytics Dashboard 🚀

Real-time insights on your shop's performance.

@if(count($insights) > 0)
Smart Insights & Recommendations
@foreach($insights as $insight)
{{ $insight['message'] }}
@endforeach
@endif
Total Revenue

₹{{ number_format($totalRevenue) }}

12% vs last month
Total Orders

{{ $totalOrders }}

5 new today
Avg Rating

{{ $avgRating }} / 5

{{ $totalReviews }} total reviews
Cancel Rate

{{ $cancelRate }}%

Keep below 5%
Monthly Sales Overview
Product Status

{{ $totalProducts }}

Total
Active (Approved) {{ $approvedProducts }}
Pending Review {{ $pendingProducts }}
Rejected {{ $rejectedProducts }}
Avg Approval Time: {{ $avgApprovalHours }} hrs
Top Selling Products
@forelse($topProducts as $item) @empty @endforelse
Product Sold Revenue
@php $img = $item->product->images->where('is_primary', 1)->first(); @endphp
{{ $item->product->name }}
SKU: {{ $item->product->sku }}
{{ $item->sold }} ₹{{ number_format($item->sold * $item->product->sale_price ?? $item->product->price) }}
No sales yet
Earnings Breakdown

₹{{ number_format($earnings['month']) }}

Earnings this Month
Today
₹{{ number_format($earnings['today']) }}
This Week
₹{{ number_format($earnings['week']) }}
Pending Payout
To be processed next cycle
₹{{ number_format($earnings['pending']) }}
Feedback Overview

{{ $avgRating }}

Average Rating
@foreach([5,4,3,2,1] as $star) @php $count = $ratingsCount[$star] ?? 0; $percent = $totalReviews > 0 ? ($count / $totalReviews) * 100 : 0; $color = $star >= 4 ? 'bg-success' : ($star == 3 ? 'bg-warning' : 'bg-danger'); @endphp
{{ $star }}
{{ $count }}
@endforeach
Recent Alerts
Quality Improvement Needed

2 products have rating below 3.0. Check reviews for details.

Low Performing / Review Needed
@forelse($lowPerforming as $product)
{{ $product->name }}
@if($product->orderItems_count == 0) Zero Sales @else Low Rating @endif Stock: {{ $product->stock_qty }}
Fix
@empty
Great! No low performing products found.
@endforelse
@push('scripts') @endpush @endsection