Skip to content

Commit 1e85210

Browse files
add channel notification
1 parent aaa9ff6 commit 1e85210

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace ProcessMaker\Notifications;
4+
5+
use Illuminate\Notifications\Notification;
6+
7+
class NotificationChannel extends Notification
8+
{
9+
public function send($notifiable, Notification $notification)
10+
{
11+
$data = $notification->toDatabase($notifiable);
12+
13+
return $notifiable->routeNotificationFor('database')->create([
14+
'id' => $notification->id,
15+
'type' => get_class($notification),
16+
'notifiable_id' => $notifiable->getKey(),
17+
'notifiable_type' => get_class($notifiable),
18+
'data' => $data,
19+
'url' => $data['url'],
20+
'read_at' => null,
21+
]);
22+
}
23+
}

0 commit comments

Comments
 (0)