@extends('layouts.bootstrap') @section('title', 'Dashboard') @section('header')

Dashboard

Welcome back, {{ auth()->user()->name }}!
@endsection @section('content') @if(auth()->user()->canManage())
@endif
Total Products
{{ $stats['total_products'] }}
Categories
{{ $stats['total_categories'] }}
Subcategories
{{ $stats['total_subcategories'] }}
Users
{{ $stats['total_users'] }}
Recent Products
View All
@if($recentProducts->count() > 0)
@foreach($recentProducts as $product) @endforeach
Product Category Price Created
{{ $product->name }} @if($product->isIncomplete()) Incomplete @endif {{ $product->category->name ?? '-' }} @if($product->price) ${{ number_format($product->price, 2) }} @else - @endif {{ $product->created_at->diffForHumans() }}
@else

No products found.

@endif
Categories Overview
@if($categoriesWithCounts->count() > 0) @foreach($categoriesWithCounts as $category)
{{ $category->name }} {{ $category->products_count }} products
@endforeach @else

No categories found.

@endif
@if($recentPriceChanges->count() > 0)
Recent Price Changes
@foreach($recentPriceChanges as $change) @php $oldPrice = $change->field_changes['price'] ?? 0; $newPrice = $change->product->price ?? 0; $difference = $newPrice - $oldPrice; $percentChange = $oldPrice > 0 ? (($difference / $oldPrice) * 100) : 0; @endphp @endforeach
Product Changed By Old Price New Price Change Date
{{ $change->product->name }} {{ $change->user->name }} ${{ number_format($oldPrice, 2) }} ${{ number_format($newPrice, 2) }} {{ $difference >= 0 ? '+' : '' }}{{ number_format($percentChange, 1) }}% {{ $change->created_at->diffForHumans() }}
@endif @endsection @push('styles') @endpush