feat: get discord Webhook form new table
This commit is contained in:
parent
ec1c91fb75
commit
6cab8b4598
1 changed files with 6 additions and 3 deletions
|
|
@ -13,10 +13,13 @@ class DiscordChannel
|
||||||
public function send(SendsDiscord $notifiable, Notification $notification): void
|
public function send(SendsDiscord $notifiable, Notification $notification): void
|
||||||
{
|
{
|
||||||
$message = $notification->toDiscord();
|
$message = $notification->toDiscord();
|
||||||
$webhookUrl = $notifiable->routeNotificationForDiscord();
|
|
||||||
if (! $webhookUrl) {
|
$discordSettings = $notifiable->discordNotificationSettings;
|
||||||
|
|
||||||
|
if (! $discordSettings || ! $discordSettings->isEnabled() || ! $discordSettings->discord_webhook_url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SendMessageToDiscordJob::dispatch($message, $webhookUrl);
|
|
||||||
|
SendMessageToDiscordJob::dispatch($message, $discordSettings->discord_webhook_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue