@extends('layouts.admin') @section('title', 'All Products') @section('content') @php $select = 'h-11 px-3 rounded-xl border border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-sm outline-none focus:ring-2 ring-brand-500'; @endphp {{-- Breadcrumb --}}
Products/All products
{{-- Success message --}} @if (session('success'))
{{ session('success') }}
@endif
{{-- Search + Filter --}}
@if (request()->hasAny(['q', 'category', 'brand'])) Reset @endif
+ Create Product
{{-- Table --}}
@forelse ($products as $p) @php $unit = $p->unit?->short_name; @endphp @empty @endforelse
Product Code Category Brand Cost Price Stock Action
@if ($p->image) {{ $p->name }} @else @endif
{{ $p->name }}
{{ $p->code }} {{ $p->category->name }} {{ $p->brand->name ?? '—' }} {{ number_format($p->cost, 2) }} {{ number_format($p->price, 2) }}{{ $unit ? ' / ' . $unit : '' }} @if ($p->stock_qty <= 0) Out of stock @elseif ($p->stock_qty <= $p->stock_alert) Low · {{ $p->stock_qty }} {{ $unit }} @else {{ $p->stock_qty }} {{ $unit }} @endif Edit
@csrf @method('DELETE')
Kono product paoa jayni. Notun product add koro
{{-- Pagination --}} @if ($products->hasPages())
{{ $products->links() }}
@endif
@endsection