feat(notification): add Pushover

This commit is contained in:
Zao Soula
2024-12-11 15:54:11 +01:00
parent 1908d8a180
commit ef35429533
31 changed files with 815 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToPushoverJob;
use Illuminate\Notifications\Notification;
class PushoverChannel
{
public function send(SendsPushover $notifiable, Notification $notification): void
{
$message = $notification->toPushover();
$pushoverSettings = $notifiable->pushoverNotificationSettings;
if (! $pushoverSettings || ! $pushoverSettings->isEnabled() || ! $pushoverSettings->pushover_user || ! $pushoverSettings->pushover_token) {
return;
}
SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_token, $pushoverSettings->pushover_user);
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace App\Notifications\Channels;
interface SendsPushover
{
public function routeNotificationForPushover();
}