mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
update notification
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Notifications;
|
||||
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\BroadcastMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
@@ -13,6 +14,7 @@ class Alert extends Notification
|
||||
|
||||
protected $fromUser;
|
||||
protected $myNotification;
|
||||
private $myUrl;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
@@ -34,7 +36,7 @@ class Alert extends Notification
|
||||
*/
|
||||
public function via($notifiable)
|
||||
{
|
||||
return ['database'];
|
||||
return ['database','broadcast'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,4 +53,18 @@ class Alert extends Notification
|
||||
'url' => $this->myUrl,
|
||||
];
|
||||
}
|
||||
|
||||
public function toBroadcast($notifiable)
|
||||
{
|
||||
return new BroadcastMessage([
|
||||
'from' => $this->fromUser,
|
||||
'msg' => $this->myNotification,
|
||||
'url' => $this->myUrl,
|
||||
]);
|
||||
}
|
||||
|
||||
public function broadcastType()
|
||||
{
|
||||
return 'notification.alert';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user