@extends('layouts.app') @section('content')
Total Produits
{{ $stats['total_products'] ?? 0 }}
Dans l'inventaire
Stock Bas
{{ $stats['low_stock'] ?? 0 }}
Attention requise
Rupture
{{ $stats['out_of_stock'] ?? 0 }}
Urgent
Valeur Stock
{{ number_format($stats['total_value'] ?? 0, 0) }}
MAD

Alertes WhatsApp

Recevez des notifications automatiques sur WhatsApp

@if(Auth::user()->whatsapp_phone && Auth::user()->whatsapp_alerts_enabled) Activé @else Désactivé @endif
@csrf
🇲🇦 +212

Format: 0612345678 ou 612345678

@if(Auth::user()->whatsapp_phone && Auth::user()->whatsapp_alerts_enabled)

Vous recevrez des alertes pour:

  • 📉 Stock bas - Quand un produit atteint le seuil minimum
  • 🚨 Rupture - Quand un produit est en rupture de stock (0)
  • 📦 Mouvements - Lors d'ajouts ou retraits importants
@else

Configuration requise

Veuillez entrer votre numéro WhatsApp et activer les notifications pour recevoir des alertes automatiques.

@endif
@if($alerts->where('is_read', false)->count() > 0)

🚨 Alertes Stock ({{ $alerts->where('is_read', false)->count() }})

@foreach($alerts->where('is_read', false)->take(6) as $alert)
@if($alert->type === 'out_of_stock')
@else
⚠️
@endif
{{ $alert->product->name ?? 'Produit' }}
@if($alert->type === 'out_of_stock')
❌ Rupture de stock!
@else
⚠️ Stock: {{ $alert->current_stock }} {{ $alert->product->unit }}
@endif
{{ $alert->created_at->diffForHumans() }}
@endforeach
@endif

Ajouter un Nouveau Produit

@csrf

Liste des Produits ({{ $products->count() ?? 0 }})

@if(($products->count() ?? 0) > 0) @foreach($products as $index => $product) @endforeach
# Produit SKU Prix Stock Niveau Statut Actions
{{ $index + 1 }}
{{ $product->name ?? 'N/A' }}
@if($product->description)
{{ Str::limit($product->description, 50) }}
@endif
@if($product->sku) {{ $product->sku }} @else - @endif
{{ number_format($product->price ?? 0, 2) }}
MAD
{{ $product->current_stock ?? 0 }}
{{ $product->unit ?? 'pièce' }}
{{ $product->getStockPercentage() ?? 0 }}%
@if($product->isOutOfStock()) ❌ Rupture @elseif($product->isLowStock()) ⚠️ Bas @else ✅ Normal @endif
@if(Auth::user()->whatsapp_phone && Auth::user()->whatsapp_alerts_enabled) @endif
@else
📦
Aucun produit en stock
Ajoutez votre premier produit ci-dessus
@endif
@endsection