diff --git a/app/Http/Controllers/bo/DashboardController.php b/app/Http/Controllers/bo/DashboardController.php index 643d087..440521a 100644 --- a/app/Http/Controllers/bo/DashboardController.php +++ b/app/Http/Controllers/bo/DashboardController.php @@ -26,7 +26,11 @@ class DashboardController extends Controller // Données calculées à afficher $totalParticipation = Participation::count(); - $avgParticipUser = round($totalParticipation / count($participationsUnique), 1); + if (count($participationsUnique) > 0){ + $avgParticipUser = round($totalParticipation / count($participationsUnique), 1); + } else { + $avgParticipUser = 0; + } // Tableau des dates comprises dans la table participation foreach ($participations as $participation)