Skip to content

Commit 7b340d3

Browse files
authored
Add Laravel 13 compatibility and Slack webhook signature fix
1 parent 545a221 commit 7b340d3

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ jobs:
1212
fail-fast: true
1313
matrix:
1414
php: [8.1, 8.2, 8.3]
15-
laravel: ['10.*', '11.*', '12.*']
15+
laravel: ['10.*', '11.*', '12.*', '13.*']
1616
exclude:
1717
- laravel: 11.*
1818
php: 8.1
1919
- laravel: 12.*
2020
php: 8.1
21+
- laravel: 13.*
22+
php: 8.1
23+
- laravel: 13.*
24+
php: 8.2
2125

2226
name: P${{ matrix.php }} - L${{ matrix.laravel }}
2327

src/Channels/DiscordWebhookChannel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use GuzzleHttp\Client as HttpClient;
99
use Illuminate\Notifications\Channels\SlackWebhookChannel;
1010
use Illuminate\Notifications\Messages\SlackMessage;
11+
use Illuminate\Notifications\Slack\SlackMessage as LaravelSlackMessage;
1112
use Illuminate\Notifications\Notification;
1213

1314
class DiscordWebhookChannel
@@ -46,7 +47,7 @@ public function send($notifiable, Notification $notification)
4647

4748
$message = $notification->toDiscord($notifiable);
4849

49-
if($message instanceof SlackMessage) {
50+
if ($message instanceof SlackMessage || $message instanceof LaravelSlackMessage) {
5051
$slackWebhook = new SlackWebhookChannel($this->http);
5152
return $this->http->post($url . '/slack', $slackWebhook->buildJsonPayload($message));
5253
}

0 commit comments

Comments
 (0)