diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php index 5769d917..59846fee 100644 --- a/app/Http/Controllers/NotificationController.php +++ b/app/Http/Controllers/NotificationController.php @@ -51,8 +51,10 @@ class NotificationController extends Controller ],200); } - public function readNotification(){ - $affected = DB::table('notifications')->Where('user_id', Auth::user()->id)->update(array('is_read' => 1)); - return response()->json("Read all message", 200); + public function readNotification($notification_id){ + $affected = DB::table('notifications') + ->Where('id', $notification_id) + ->update(array('is_read' => 1)); + return response()->json("Read message", 200); } } \ No newline at end of file diff --git a/resources/assets/js/components/Navbar.vue b/resources/assets/js/components/Navbar.vue index 5bef4d5e..bfe6afe3 100644 --- a/resources/assets/js/components/Navbar.vue +++ b/resources/assets/js/components/Navbar.vue @@ -18,21 +18,22 @@