@if ($search || $categoryFilter || $statusFilter !== 'all' || $stockFilter !== 'all') @endif
@can('products.create') @endcan
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @can('products.delete') @if (count($selected) > 0)
{{ count($selected) }} {{ Str::plural('product', count($selected)) }} selected
@endif @endcan
@php $filtersActive = $search || $categoryFilter || $statusFilter !== 'all' || $stockFilter !== 'all'; @endphp @if ($products->isEmpty() && $filtersActive) @elseif ($products->isEmpty()) @else
@can('products.delete') @endcan ProductSKUCategoryMRPSelling PriceQty AvailableStatus @foreach ($products as $product) @can('products.delete') @endcan @php $qtyAvailable = (int) ($product->stock_balances_sum_quantity ?? 0); @endphp @endforeach
{{ $product->name }}
@if ($product->brand)
{{ $product->brand }}
@endif
{{ $product->sku }} {{ $product->category?->name ?? '—' }} {{ $product->mrp !== null ? number_format($product->mrp, 2) : '—' }} {{ $product->selling_price !== null ? number_format($product->selling_price, 2) : '—' }} $qtyAvailable === 0, 'text-amber-600 dark:text-amber-400' => $qtyAvailable > 0 && $qtyAvailable <= $product->reorder_level, 'text-gray-800 dark:text-gray-100' => $qtyAvailable > $product->reorder_level, ])> {{ number_format($qtyAvailable) }} $product->is_active, 'bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400' => ! $product->is_active, ])> {{ $product->is_active ? 'Active' : 'Inactive' }} View @can('products.update') @endcan @can('products.delete') @endcan
{{ $products->links() }}
@endif
@if ($showForm)

{{ $editingId ? 'Edit Product' : 'New Product' }}

Identity

Pricing

Stock thresholds

@endif