mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
26 lines
543 B
PHP
26 lines
543 B
PHP
<?php
|
|
|
|
namespace App\NotificationsChannels;
|
|
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class NtfyChannel
|
|
{
|
|
protected $ntfy;
|
|
|
|
public function __construct(Ntfy $ntfy)
|
|
{
|
|
$this->ntfy = $ntfy;
|
|
}
|
|
|
|
/**
|
|
* Send the given notification.
|
|
*/
|
|
public function send(object $notifiable, Notification $notification)
|
|
{
|
|
$message = $notification->toNtfy($notifiable);
|
|
|
|
return $this->ntfy->send(notification: $message["headers"], notification_content: $message["content"], user: $notifiable);
|
|
}
|
|
}
|