@extends('layouts.supplier') @section('title', 'Produk Saya') @section('content')

Katalog Produk Saya

Kelola daftar dan status pengajuan produk konsinyasi Anda

@php $supplier = Auth::guard('supplier')->user(); $totalProducts = $products->total(); $activeCount = \App\Models\Product::where('supplierId', $supplier->id) ->where('approvalStatus', 'APPROVED') ->where('isActive', true) ->count(); $pendingCount = \App\Models\Product::where('supplierId', $supplier->id) ->where('approvalStatus', 'PENDING') ->count(); $rejectedCount = \App\Models\Product::where('supplierId', $supplier->id) ->where('approvalStatus', 'REJECTED') ->count(); @endphp
Total SKU

{{ $totalProducts }}

Disetujui

{{ $activeCount }}

/{{ $supplier->maxActiveProducts ?? 20 }}
Menunggu

{{ $pendingCount }}

Ditolak

{{ $rejectedCount }}

{{-- Mobile View Cards --}}
@forelse($products as $product) @php $canModify = in_array($product->approvalStatus, ['PENDING', 'REJECTED'], true); @endphp
@if($product->image) {{ $product->name }} @else
@endif
{{ $product->name }}
{{ $product->sku }}
@if($canModify)
@csrf @method('DELETE')
@else @endif
Rp {{ number_format($product->buyPrice, 0, ',', '.') }} @if($product->approvalStatus === 'PENDING') Menunggu @elseif($product->approvalStatus === 'REJECTED') Ditolak @elseif($product->approvalStatus === 'APPROVED') @if($product->stock > 0) Stok: {{ $product->stock }} @else Stok Habis @endif @endif
@empty

Belum ada produk diajukan.

Ajukan Produk Pertama Anda
@endforelse
{{-- Desktop Table View --}} @if($products->hasPages())
{{ $products->links() }}
@endif
@endsection