Files
2025-09-27 16:53:29 +04:00

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