@extends('layouts.app') @section('title', 'Commandes Alimentaires') @push('styles') @endpush @section('content') {{-- Section d'aide --}}
{{-- Header Premium --}}

Mes Commandes

Historique et gestion complète

{{-- Statistiques --}}

{{ $stats['pending'] ?? 0 }}

En attente

{{ $stats['in_progress'] ?? 0 }}

En cours

{{ $stats['today_completed'] ?? 0 }}

Aujourd'hui

{{ number_format($stats['today_revenue'] ?? 0, 0) }}€

Recettes

{{-- Filtres --}}
@if(request()->hasAny(['status', 'period'])) @endif
{{-- Liste des commandes --}}
{{-- Guide pour le prestataire --}}
📚

Guide de gestion des commandes

1️⃣ Nouvelle commande

Vous recevez une notification. Acceptez ou refusez rapidement.

2️⃣ Préparation

Passez en "préparation" quand vous commencez à cuisiner.

3️⃣ Prête

Marquez "prête" - le client est notifié automatiquement.

4️⃣ Terminée

Confirmez la livraison/récupération pour finaliser.

Astuce : Plus vous êtes réactif, plus vous recevez de bonnes évaluations !

@if($orders->isEmpty())

Aucune commande

Vous n'avez pas encore reçu de commandes alimentaires

Gérer mon menu
@else
@foreach($orders as $order) @php $statusConfig = [ 'pending' => ['gradient' => 'from-amber-400 to-orange-500', 'bg' => 'bg-amber-50', 'text' => 'text-amber-700', 'icon' => '⏳', 'label' => 'En attente'], 'accepted' => ['gradient' => 'from-blue-400 to-blue-600', 'bg' => 'bg-blue-50', 'text' => 'text-blue-700', 'icon' => '✓', 'label' => 'Acceptée'], 'preparing' => ['gradient' => 'from-purple-400 to-purple-600', 'bg' => 'bg-purple-50', 'text' => 'text-purple-700', 'icon' => '🔥', 'label' => 'En préparation'], 'ready' => ['gradient' => 'from-green-400 to-emerald-500', 'bg' => 'bg-green-50', 'text' => 'text-green-700', 'icon' => '✅', 'label' => 'Prête'], 'delivered' => ['gradient' => 'from-emerald-400 to-teal-500', 'bg' => 'bg-emerald-50', 'text' => 'text-emerald-700', 'icon' => '📦', 'label' => 'Livrée'], 'completed' => ['gradient' => 'from-gray-400 to-gray-600', 'bg' => 'bg-gray-50', 'text' => 'text-gray-700', 'icon' => '🏁', 'label' => 'Terminée'], 'cancelled' => ['gradient' => 'from-red-400 to-red-600', 'bg' => 'bg-red-50', 'text' => 'text-red-700', 'icon' => '❌', 'label' => 'Annulée'], 'rejected' => ['gradient' => 'from-red-400 to-red-600', 'bg' => 'bg-red-50', 'text' => 'text-red-700', 'icon' => '🚫', 'label' => 'Refusée'], ]; $config = $statusConfig[$order->status] ?? $statusConfig['pending']; @endphp
{{-- Barre de statut --}}
{{-- Contenu principal --}}
#{{ $order->order_number }} {{ $config['icon'] }} {{ $config['label'] }}
{{ $order->client->name ?? 'Client' }} {{ $order->created_at->format('d/m H:i') }}
{{ number_format($order->total, 2) }} €
@if($order->delivery_type === 'pickup') À emporter @else Livraison @endif
{{-- Articles --}}
@foreach($order->items->take(4) as $item) {{ $item->quantity }}× {{ Str::limit($item->product_name, 20) }} @endforeach @if($order->items->count() > 4) +{{ $order->items->count() - 4 }} autres @endif
@if($order->notes)
{{ Str::limit($order->notes, 100) }}
@endif
{{-- Actions --}}
Détails @if($order->status === 'pending')
@csrf
@elseif($order->status === 'accepted')
@csrf
@elseif($order->status === 'preparing')
@csrf
@elseif($order->status === 'ready') @if(($order->delivery_type ?? '') === 'pickup')
@csrf
@else @endif @endif
@endforeach
{{-- Pagination --}} @if($orders->hasPages())
{{ $orders->links() }}
@endif @endif
@endsection