@extends('layouts.app') @section('title', 'Mon Menu - Produits') @push('styles') @endpush @section('content')
{{-- ── Toast succès ── --}} @if(session('success'))

{{ session('success') }}

@endif {{-- ── Header compact ── --}}

🍽️ Mon Menu ({{ $products->total() }})

{{-- ── Stats inline + Filtres ── --}}
{{-- Stats mini --}}
🍕 {{ $products->total() }} produits
✅ {{ $products->where('is_available', true)->count() }} dispo
⏸️ {{ $products->where('is_available', false)->count() }} pause
📂 {{ $products->pluck('category')->unique()->count() }} catégories
{{-- Filtres --}}
{{-- Statut --}}
{{-- Catégories --}}
@php $categoryLabels = [ 'entree' => '🥗 Entrées', 'plat' => '🍖 Plats', 'dessert' => '🍰 Desserts', 'boisson' => '🥤 Boissons', 'amuse_bouche' => '🍢 Amuse-B.', 'gateau' => '🎂 Gâteaux', 'pizza' => '🍕 Pizzas', 'sandwich' => '🥪 Sandwichs', 'salade' => '🥗 Salades', 'autre' => '📦 Autres', ]; $usedCategories = $products->pluck('category')->unique()->sort(); @endphp @foreach($usedCategories as $cat) @endforeach
{{-- ── Grille produits ── --}}
@if($products->isEmpty())
🍽️

Aucun produit

Commencez par ajouter vos premiers produits

➕ Créer mon premier produit
@else @php $groupedProducts = $products->groupBy('category'); @endphp
@foreach($groupedProducts as $category => $categoryProducts) {{-- Category divider --}}
{{ $categoryLabels[$category] ?? '📦 ' . ucfirst($category) }} {{ $categoryProducts->count() }}
@foreach($categoryProducts as $product)
{{-- Image --}}
@if($product->image) {{ $product->name }} @else
{{ explode(' ', $categoryLabels[$product->category] ?? '🍽️')[0] }}
@endif {{-- Prix --}}
{{ number_format($product->price, 2) }}€
{{-- Status --}}
{{ $product->is_available ? 'Dispo' : 'Pause' }}
{{-- Body --}}
{{ $product->name }}
@if($product->description)
{{ $product->description }}
@endif
@if($product->preparation_time) ⏱️ {{ $product->preparation_time }}min @endif @if($product->stock !== null) 📦 {{ $product->stock }} @endif
{{-- Actions --}}
@csrf
✏️
@csrf @method('DELETE')
@endforeach @endforeach
{{-- Pagination --}} @if($products->hasPages())
{{ $products->links() }}
@endif @endif
@push('scripts') @endpush @endsection