Products

{{ $products->total() }} {{ \Illuminate\Support\Str::plural('product', $products->total()) }}
@foreach (['all' => 'All'] + collect(\App\Enums\ProductStatus::cases())->mapWithKeys(fn ($s) => [$s->value => $s->label()])->all() as $key => $label) @endforeach
@if ($rows->isEmpty())

{{ $search ? 'No products match "'.$search.'".' : 'No products yet.' }}

Add your first product
@else ProductTypeColoursFromStockStatus @foreach ($rows as $row) @php $p = $row['product']; @endphp @if ($img = $p->images->first())@else@endif {{ $p->name }}{{ $p->variants->pluck('sku')->implode(', ') }} {{ $p->type->label() }} @foreach ($p->variants->pluck('colour')->filter()->unique('id') as $c)@endforeach {{ $row['from'] !== null ? money($row['from']) : '—' }} @if ($row['onSale'])Sale@endif @if ($row['stock'] <= 0)Out@elseif ($row['low']){{ $row['stock'] }}@else{{ $row['stock'] }}@endif {{ $p->status->label() }} Edit @if ($p->status !== \App\Enums\ProductStatus::Archived) @endif @endforeach
{{ $products->links() }}
@endif