Fix notification frontend

This commit is contained in:
weiweitoo
2018-07-25 15:02:43 +08:00
parent 336e5e4ed3
commit d9a818c05a
4 changed files with 40 additions and 35 deletions
@@ -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);
}
}