feat: slack notifications

This commit is contained in:
Marvin von Rappard committed 2024-11-12 22:37:55 +01:00
1 parent 9af3fe9c97
commit eb0686fe20
27 files changed
+822 -181

No files matched your search

@@ -0,0 +1,22 @@
<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToSlackJob;
use Illuminate\Notifications\Notification;
class SlackChannel
{
/**
* Send the given notification.
*/
public function send(SendsSlack $notifiable, Notification $notification): void
{
$message = $notification->toSlack();
$webhookUrl = $notifiable->routeNotificationForSlack();
if (!$webhookUrl) {
return;
}
dispatch(new SendMessageToSlackJob($message, $webhookUrl))->onQueue('high');
}
}