Browse Source

some chang in notif helper class and SocketNotification.php message

mahdi
mahdihty 4 years ago
parent
commit
5dc7407dda
  1. 4
      app/Notifications/SocketNotification.php
  2. 6
      app/Utilities/HelperClass/NotificationHelper.php
  3. 4
      routes/api.php

4
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'],
]);
}
}

6
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));
}
}

4
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) {

Loading…
Cancel
Save