@extends('layouts.app') @section('style') @endsection @section('content')
Advanced Filters

Total Products

{{ $products->total() }}

Active Products

{{ $products->where('status', 'active')->count() }}

Low Stock

{{ $products->where('stock', '<=', \DB::raw('minimum_stock'))->where('stock', '>', 0)->count() }}

Out of Stock

{{ $products->where('stock', '<=', 0)->count() }}

@if(session('success')) @endif @if(session('error')) @endif
@forelse($products as $product) @empty @endforelse
Product SKU/Barcode Category Stock Price Status Actions
@if($product->image) {{ $product->name }} @else
@endif
{{ $product->name }}
{{ Str::limit($product->short_description, 40) }}
@if($product->is_featured) Featured @endif @if($product->has_expiry) Expiry @endif @if($product->track_batches) Batches @endif
{{ $product->sku }} @if($product->barcode) {{ $product->barcode }} @endif @if($product->ref_number) Ref: {{ $product->ref_number }} @endif
@if($product->category) {{ $product->category->name }} @else - @endif @if($product->brand)
{{ $product->brand->name }}
@endif
{{ $product->stock }} {{ Str::title(str_replace('_', ' ', $product->stock_status)) }} @if($product->has_expiry && $product->expiry_summary['has_expiry']) @php $expirySummary = $product->expiry_summary; @endphp @if($expirySummary['alert_level'] != 'normal')
@if($expirySummary['expired_quantity'] > 0) {{ $expirySummary['expired_quantity'] }} expired @elseif($expirySummary['expiring_soon_quantity'] > 0) {{ $expirySummary['expiring_soon_quantity'] }} expiring @endif
@endif @endif
KES{{ number_format($product->final_price, 2) }} @if($product->discount_price || $product->discount_percent) KES{{ number_format($product->sale_price, 2) }} @endif Cost: KES{{ number_format($product->cost_price, 2) }}
{{ Str::title($product->status) }}
No products found

@if(request()->hasAny(['search', 'category_id', 'status', 'stock_status', 'has_expiry'])) Try changing your filters @else Get started by creating your first product @endif

Add New Product
@forelse($products as $product)
@if($product->image) {{ $product->name }} @else
@endif
{{ Str::limit($product->name, 30) }}

{{ $product->sku }}

{{ Str::title($product->status) }} {{ $product->stock }} @if($product->is_featured) @endif
${{ number_format($product->final_price, 2) }} @if($product->discount_price || $product->discount_percent)
${{ number_format($product->sale_price, 2) }}
@endif
@if($product->category) {{ Str::limit($product->category->name, 15) }} @endif
@csrf @method('DELETE')
@empty
No products found
Add New Product
@endforelse
Showing {{ $products->firstItem() }} to {{ $products->lastItem() }} of {{ $products->total() }} entries
@endsection @section('script') @endsection