set the notification getting system by created_at desc order

This commit is contained in:
2026-01-08 14:51:21 +01:00
parent c49a5e558f
commit 475a1c7052
2 changed files with 7 additions and 2 deletions
@@ -12,8 +12,13 @@ class NotificationsController extends Controller
{ {
public function getNotifications(Request $request): JsonResponse { public function getNotifications(Request $request): JsonResponse {
try { try {
$notif = $request->user()
->notifications()
->latest()
->get();
return response()->json([ return response()->json([
'data' => $request->user()->notifications 'data' => $notif
]); ]);
} catch(\Exception $e) { } catch(\Exception $e) {
Log::info($e->getMessage()); Log::info($e->getMessage());
+1 -1
View File
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="logoIcone.png" /> <link rel="icon" type="image/svg+xml" href="logoIcone.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Comité des fêtes de Beaupont</title> <title>Comité des fêtes de Beaupont</title>
<script type="module" crossorigin src="/assets/index-CeLi4uhf.js"></script> <script type="module" crossorigin src="/assets/index-YuAySMyG.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DBz-GVvs.css"> <link rel="stylesheet" crossorigin href="/assets/index-DBz-GVvs.css">
</head> </head>
<body> <body>