+ Udpdate notifications routes

This commit is contained in:
Djery-Tom 2020-08-21 15:17:34 +01:00
parent 559ceda346
commit 495bedc6fd
2 changed files with 8 additions and 0 deletions

View File

@ -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');
}
}

View File

@ -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');
});