From 9febb9321feda648bd942d6b7022a0d419c0348e Mon Sep 17 00:00:00 2001 From: Sofiane Lasri-Trienpont <alasri250@gmail.com> Date: Fri, 14 Feb 2025 17:11:43 +0100 Subject: [PATCH] fix: update mapping for visits by country in HomeController Updated the mapping in the `HomeController` to use 'country_code' instead of 'country' for better clarity in the visits data structure. --- app/Http/Controllers/Admin/HomeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index c4aba2c..2986129 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -44,7 +44,7 @@ public function index(): View ->values(); $visitsByCountry = $visits->groupBy('country_code') - ->map(fn ($group, $country) => ['country' => $country, 'count' => $group->count()]) + ->map(fn ($group, $country) => ['country_code' => $country, 'count' => $group->count()]) ->values(); $mostVisitedPages = $visits->groupBy('url') -- GitLab