@extends('layouts.app') @section('title', 'Products') @section('content')

Product Catalog

Add Product
Reset
@forelse($products as $product) @php // Safely check if product is enabled for this user $userProduct = auth()->user()->products->where('id', $product->id)->first(); $isChecked = $userProduct && $userProduct->pivot && $userProduct->pivot->is_enabled; @endphp @empty @endforelse
Sell SKU Product Name Type Price Stock Status Actions
{{ $product->sku ?: '-' }}
{{ $product->name }} @if($product->isAdminProduct()) Global @endif
@if($product->description)

{{ Str::limit($product->description, 50) }}

@endif
@if($product->isBundle()) Bundle @if($product->bundle_items)
{{ count($product->bundle_items) }} items:
@foreach($product->bundle_items as $bundleItem)
• {{ $bundleItem['name'] ?? $bundleItem['sku'] ?? 'N/A' }} x{{ $bundleItem['quantity'] }}
@endforeach
@endif @else Single @endif
RM {{ number_format($product->price, 2) }} {{ $product->stock ?? '-' }} @if($product->is_active) Active @else Inactive @endif @if($product->user_id === auth()->id())
Edit
@csrf @method('DELETE')
@else Read-only @endif
No products found. Add your first product
@if($products->hasPages())
{{ $products->links() }}
@endif
@endsection @push('scripts') @endpush