@extends('layouts.vendor') @section('page-title', 'Inventory') @push('styles') @endpush @section('content')
{{-- Page Header --}} {{-- Stats Row --}}
@php $totalProducts = $products->total(); $inStock = $products->where(function($p){ return $p->stock_quantity > $p->low_stock_threshold; })->count(); $lowStock = $products->where(function($p){ return $p->stock_quantity <= $p->low_stock_threshold && $p->stock_quantity > 0; })->count(); $outOfStock = $products->where('stock_quantity', 0)->count(); @endphp
Total Products {{ $totalProducts }}
In Stock {{ $inStock }}
Low Stock {{ $lowStock }}
Out of Stock {{ $outOfStock }}
{{-- Inventory Table --}}
Stock Levels
@forelse($products as $product) @empty @endforelse
Product SKU Stock Threshold Status Tracking
{{ $product->name }} {{ $product->sku ?? '-' }}
@csrf @method('PATCH')
{{ $product->low_stock_threshold }} @if($product->stock_quantity <= 0) Out of Stock @elseif($product->stock_quantity <= $product->low_stock_threshold) Low Stock @else In Stock @endif {{ $product->track_inventory ? 'Tracking' : 'Not tracking' }}

No inventory items

@if($products->hasPages())
{{ $products->links() }}
@endif
@endsection