Skip to content

Commit 0ad9814

Browse files
SaifiKhambhatiyashbarot
authored andcommitted
Added module enable/disable feature (#4)
* Added module enable/disable feature * Added trailing comma
1 parent 48ba641 commit 0ad9814

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

config/push-notification.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@
4242
'logs' => [
4343
'table' => 'notification_logs',
4444
],
45+
46+
'moduleEnable' => [
47+
'notification' => true,
48+
],
4549
];

src/Classes/PushNotificationClass.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ class PushNotificationClass
1212
{
1313
public function send($deviceTokens, $message, $action)
1414
{
15-
Queue::push(new PushNotificationJob($deviceTokens, $message, $action));
15+
$notificationEnable = config('push-notification.moduleEnable.notification');
16+
17+
if ($notificationEnable) {
18+
Queue::push(new PushNotificationJob($deviceTokens, $message, $action));
19+
}
20+
21+
return response()->json(['message' => $message]);
1622
}
1723
}

0 commit comments

Comments
 (0)