fix: only send internal notifcations to enabled channels
This commit is contained in:
parent
02f6673345
commit
ec4234e243
1 changed files with 11 additions and 1 deletions
|
|
@ -19,7 +19,17 @@ public function __construct(public string $message)
|
||||||
|
|
||||||
public function via(object $notifiable): array
|
public function via(object $notifiable): array
|
||||||
{
|
{
|
||||||
return [TelegramChannel::class, DiscordChannel::class];
|
$channels = [];
|
||||||
|
$isDiscordEnabled = data_get($notifiable, 'discord_enabled');
|
||||||
|
$isTelegramEnabled = data_get($notifiable, 'telegram_enabled');
|
||||||
|
|
||||||
|
if ($isDiscordEnabled) {
|
||||||
|
$channels[] = DiscordChannel::class;
|
||||||
|
}
|
||||||
|
if ($isTelegramEnabled) {
|
||||||
|
$channels[] = TelegramChannel::class;
|
||||||
|
}
|
||||||
|
return $channels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toDiscord(): string
|
public function toDiscord(): string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue