@extends('admin_base') @section('title', $product->title . ' - Analytics') @section('active_menu', 'products.inventory') @section('style') @endsection @section('content')

Product Analytics

Edit Product
{{ number_format($totalSales) }}
Total Units Sold
৳{{ number_format($totalRevenue) }}
Total Revenue
{{ number_format($thisMonthSales) }}
Units Sold This Month
{{ number_format($product->average_rating, 1) }}
Average Rating ({{ $product->ratings_count }} reviews)
Monthly Performance
Variant Performance
@foreach($variantSales as $variant)
{{ $variant->label }}
Revenue: ৳{{ number_format($variant->total_revenue) }}
Units Sold: {{ number_format($variant->total_quantity) }}
@endforeach
Rating Distribution
Recent Reviews
@foreach($recentReviews->take(10) as $review)
@for($i = 1; $i <= 5; $i++) @if($i <= $review->rating) @else @endif @endfor
{{ $review->user->first_name }} {{ $review->user->last_name }} • {{ $review->created_at->diffForHumans() }}
@csrf @method('DELETE')
{{ $review->comment }}
@endforeach
Current Stock Levels
@foreach($product->variations as $variant) @php $stockClass = $variant->stock > 10 ? 'high' : ($variant->stock > 5 ? 'medium' : 'low'); $stockLabel = $variant->stock > 10 ? 'In Stock' : ($variant->stock > 5 ? 'Medium Stock' : 'Low Stock'); @endphp
{{ $variant->unit_value }}
{{ $stockLabel }}
Unit Type {{ $variant->unit_type }}
Unit Value {{ $variant->unit_value }}
Regular Price ৳{{ number_format($variant->regular_price) }}
Sale Price ৳{{ number_format($variant->sale_price) }}
@endforeach
@endsection @section('script') @endsection