From 495bedc6fdd2f630b4325aa16836a87fa0a692c8 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Fri, 21 Aug 2020 15:17:34 +0100 Subject: [PATCH] + Udpdate notifications routes --- app/Http/Controllers/NotificationController.php | 7 +++++++ routes/web.php | 1 + 2 files changed, 8 insertions(+) diff --git a/app/Http/Controllers/NotificationController.php b/app/Http/Controllers/NotificationController.php index 9b25aba..c595ca1 100644 --- a/app/Http/Controllers/NotificationController.php +++ b/app/Http/Controllers/NotificationController.php @@ -43,5 +43,12 @@ class NotificationController extends Controller return $this->successResponse($notifications); } + public function readNotification($id_notif){ + $notif = Notification::findOrFail($id_notif); + $notif->read = true; + $notif->save(); + return $this->successResponse('Success'); + } + } diff --git a/routes/web.php b/routes/web.php index 887576f..c3279e4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,4 +26,5 @@ $router->group(['prefix'=>'/onesignal'], function () use ($router) { $router->group(['prefix'=>'/notifications'], function () use ($router) { $router->post('', 'NotificationController@getNotifcations'); + $router->put('update/{id_notif}', 'NotificationController@readNotification'); });