From 475a1c7052fa91d831bde450e663fa2b3d8090ff Mon Sep 17 00:00:00 2001 From: Giovanni-Josserand Date: Thu, 8 Jan 2026 14:51:21 +0100 Subject: [PATCH] set the notification getting system by created_at desc order --- app/Http/Controllers/NotificationsController.php | 7 ++++++- public/index.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/NotificationsController.php b/app/Http/Controllers/NotificationsController.php index 7af6c84..23f3532 100644 --- a/app/Http/Controllers/NotificationsController.php +++ b/app/Http/Controllers/NotificationsController.php @@ -12,8 +12,13 @@ class NotificationsController extends Controller { public function getNotifications(Request $request): JsonResponse { try { + $notif = $request->user() + ->notifications() + ->latest() + ->get(); + return response()->json([ - 'data' => $request->user()->notifications + 'data' => $notif ]); } catch(\Exception $e) { Log::info($e->getMessage()); diff --git a/public/index.html b/public/index.html index 7de520c..1a0779c 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ ComitĂ© des fĂȘtes de Beaupont - +