lasthourcloud/app/Notifications/Channels/DiscordChannel.php
Andras Bacsai 0aa816b4f2 a lot hehe
2023-06-01 12:15:33 +02:00

20 lines
496 B
PHP

<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToDiscordJob;
use Illuminate\Notifications\Notification;
class DiscordChannel
{
/**
* Send the given notification.
*/
public function send(SendsDiscord $notifiable, Notification $notification): void
{
$message = $notification->toDiscord($notifiable);
$webhookUrl = $notifiable->routeNotificationForDiscord();
dispatch(new SendMessageToDiscordJob($message, $webhookUrl));
}
}