coolify/app/Notifications/Internal/GeneralNotification.php

35 lines
754 B
PHP
Raw Normal View History

<?php
namespace App\Notifications\Internal;
use App\Notifications\Channels\DiscordChannel;
2023-09-06 14:31:38 +02:00
use App\Notifications\Channels\TelegramChannel;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class GeneralNotification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(public string $message)
{
}
public function via(object $notifiable): array
{
2023-09-06 14:31:38 +02:00
return [TelegramChannel::class, DiscordChannel::class];
}
public function toDiscord(): string
{
return $this->message;
}
2023-09-06 14:31:38 +02:00
public function toTelegram(): array
{
return [
"message" => $this->message,
];
}
}