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 @@