@include('vendor.partials.menu')
@include('vendor.partials.top-header')

{{ __('messages.products_list') }}

@if(request()->filled('search')) {{ __('messages.reinit') }} @endif
@if($products->isEmpty())

{{ __('messages.no_product') }}

{{ __('messages.no_product_search') }}

@else
@foreach($products as $product) @php $firstImage = $product->images->first(); $imageSrc = $firstImage && !empty($firstImage->image_blob) ? 'data:' . ($firstImage->mime_type ?? 'image/png') . ';base64,' . base64_encode($firstImage->image_blob) : asset('vendor/images/fav.png'); $category = explode('→', $product->final_category)[0] ?? 'Non classé'; $category = trim($category); $stock = (int) ($product->product_stock ?? 0); if ($stock <= 0) { $stockClass = 'out-stock'; $stockIcon = 'fa-circle-xmark'; $stockLabel = __('messages.out_of_stock'); } elseif ($stock <= 10) { $stockClass = 'low-stock'; $stockIcon = 'fa-triangle-exclamation'; $stockLabel = $stock . __('messages.rest'); } else { $stockClass = 'in-stock'; $stockIcon = 'fa-box'; $stockLabel = $stock . __('messages.in_stock'); } @endphp @endforeach
{{ __('messages.product_name') }} {{ __('messages.category') }} {{ __('messages.price_datatable') }} {{ __('messages.stock') }} {{ __('messages.state') }} {{ __('messages.modify') }} {{ __('messages.delete') }}
{{ $product->product_name }}
{{ $product->product_name }}

ID : #{{ $product->id }}

{{ $category }}
{{ number_format($product->final_price, 2, ',', ' ') }} €
{{ $stockLabel }} {{ $product->etatProduit ? __('messages.' . $product->etatProduit) : __('messages.undefined') }}
@foreach($products as $product) @php $firstImage = $product->images->first(); $imageSrc = $firstImage && !empty($firstImage->image_blob) ? 'data:' . ($firstImage->mime_type ?? 'image/png') . ';base64,' . base64_encode($firstImage->image_blob) : asset('vendor/images/fav.png'); $category = explode('→', $product->final_category)[0] ?? 'Non classé'; $category = trim($category); $stock = (int) ($product->product_stock ?? 0); if ($stock <= 0) { $stockClass = 'out-stock'; $stockIcon = 'fa-circle-xmark'; $stockLabel = __('messages.out_of_stock'); } elseif ($stock <= 10) { $stockClass = 'low-stock'; $stockIcon = 'fa-triangle-exclamation'; $stockLabel = $stock . __('messages.rest'); } else { $stockClass = 'in-stock'; $stockIcon = 'fa-box'; $stockLabel = $stock . __('messages.in_stock'); } @endphp
{{ $product->product_name }}
{{ $product->product_name }}
{{ $product->id }} {{ $category }}

{{ number_format($product->final_price, 2, ',', ' ') }} €

{{ $stockLabel }}
{{ __('messages.category') }} {{ $category }}
{{ __('messages.price_datatable') }} {{ number_format($product->final_price, 2, ',', ' ') }} €
{{ __('messages.stock') }} {{ $stock }}
{{ __('messages.state') }} {{ $product->etatProduit ? __('messages.' . $product->etatProduit) : __('messages.undefined') }}
@endforeach
{{ $products->links() }}
@endif