diff --git a/app/Notifications/SocketNotification.php b/app/Notifications/SocketNotification.php index a734ba9..9a6a733 100644 --- a/app/Notifications/SocketNotification.php +++ b/app/Notifications/SocketNotification.php @@ -45,8 +45,8 @@ class SocketNotification extends Notification { return (new SocketMessage()) ->data([ - 'title' => $this->message['title'], - 'body' => $this->message['body'], + 'message' => $this->message['message'], + 'payload' => $this->message['payload'], ]); } } diff --git a/app/Utilities/HelperClass/NotificationHelper.php b/app/Utilities/HelperClass/NotificationHelper.php index 2d8859f..f668871 100644 --- a/app/Utilities/HelperClass/NotificationHelper.php +++ b/app/Utilities/HelperClass/NotificationHelper.php @@ -65,7 +65,7 @@ class NotificationHelper public function sendNotifications($users, $level = null) { switch ($level) { case "emergency": - Notification::send($users, new SmsNotification($this->sms_notif, 'ultraFastSend')); + Notification::send($users, new SmsNotification($this->sms_notif, enum('sms.types.ultra_fast_send.name'))); case "critical": Notification::send($users, new MailNotification($this->notif)); case "high": @@ -73,10 +73,10 @@ class NotificationHelper case "medium": Notification::send($users, new FcmNotification($this->notif)); case "low": - Notification::send($users, new SocketNotification($this->notif)); +// Notification::send($users, new SocketNotification($this->notif)); break; default: - Notification::send($users, new SocketNotification($this->notif)); +// Notification::send($users, new SocketNotification($this->notif)); } } diff --git a/routes/api.php b/routes/api.php index 1f7b178..087aeb0 100644 --- a/routes/api.php +++ b/routes/api.php @@ -9,8 +9,8 @@ $router->get('/lab', function () { $router->get('/ntest', function () { $user = \App\Models\User::find(1); \Illuminate\Support\Facades\Notification::send($user, new \App\Notifications\SmsNotification(['verification_code' => "1234"])); - (new \App\Utilities\HelperClass\NotificationHelper()) - ->makeSmsNotif('template_name', ['user' => 'myUser', 'business' => 'myBusiness']); +// (new \App\Utilities\HelperClass\NotificationHelper()) +// ->makeSmsNotif('template_name', ['user' => 'myUser', 'business' => 'myBusiness']); })->middleware('bindBusiness'); $router->group(['prefix' => 'actions'], function () use ($router) { $router->group(['prefix' => 'businesses'], function () use ($router) {