laravel-discord-webhook-channel maintained by snoeren-development
Last update
2026/04/18 13:29
License
Require
- php ^8.3
- guzzlehttp/guzzle ^7.9.2
- illuminate/support >=10
Last update
2026/03/30 11:28
License
Require
- guzzlehttp/guzzle ^7.9.2
- illuminate/support >=10
- php ^8.3
Last update
2026/03/30 11:28
License
Require
- php ^8.3
- guzzlehttp/guzzle ^7.9.2
- illuminate/support >=10
Last update
2026/03/30 11:23
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.9.2
- illuminate/support >=10
Last update
2025/11/13 09:32
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.9.2
- illuminate/support ^10.0||^11.0||^12.0
Last update
2025/07/22 13:52
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.9.2
- illuminate/support ^10.0||^11.0||^12.0
Last update
2025/03/30 20:21
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.9.2
- illuminate/support ^10.0||^11.0||^12.0
Last update
2024/11/07 08:59
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.9.2
- illuminate/support ^10.0|^11.0
Last update
2024/03/25 08:39
License
Require
- php ^8.2
- guzzlehttp/guzzle ^7.8.1
- illuminate/support ^10.0|^11.0
Last update
2023/09/26 10:35
License
Require
- php ^8.1
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0|^10.0
Last update
2023/06/02 21:03
License
Require
- php ^8.1
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0|^10.0
Last update
2023/02/17 15:48
License
Require
- php ^8.0
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0|^10.0
Last update
2023/01/03 16:06
License
Require
- php ^8.0
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0
Last update
2022/08/19 14:04
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0
Last update
2022/06/11 21:29
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.4.4|^6.5
- illuminate/support ^8.0|^9.0
Last update
2022/06/01 21:58
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^9.0
Last update
2022/04/01 08:50
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^9.0
Last update
2022/02/10 19:29
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^9.0
Last update
2021/12/31 09:04
License
Require
- php ^7.4|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/10/12 21:36
License
Require
- php ^7.3|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/07/01 16:45
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/05/24 09:49
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/04/30 08:29
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/03/25 12:11
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2021/02/09 10:58
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/12/07 08:15
License
Require
- php ^7.2|^8.0
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/11/24 09:07
License
Require
- php ^7.2
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/11/21 10:41
License
Require
- php ^7.2
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/11/13 09:17
License
Require
- php ^7.2
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/10/18 08:32
License
Require
- php ^7.2
- guzzlehttp/guzzle ^7.0|^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/09/10 08:31
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^8.0|^7.0|^6.0
Last update
2020/09/02 21:10
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^7.0|^6.0
Last update
2020/08/27 07:45
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^7.0|^6.0
Last update
2020/06/04 11:23
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^7.0|^6.0
Last update
2020/04/23 08:54
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^7.0
Last update
2020/03/09 17:22
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^7.0
Last update
2020/02/27 23:14
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^6
Last update
2020/01/11 14:26
License
Require
- php ^7.2
- guzzlehttp/guzzle ^6.5
- illuminate/support ^6
Laravel Discord Webhook Channel
Installation
You can install the package using Composer:
composer require snoeren-development/laravel-discord-webhook-channel
Requirements
This package requires at least PHP 8.2 and Laravel 10.
Usage
In every notifiable model you wish to notify via Discord, you need to add the routeNotificationForDiscord method;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
class User extends Model
{
use Notifiable;
/**
* Route the notification for Discord.
*
* @return string
*/
public function routeNotificationForDiscord(): string
{
return $this->discord_webhook;
}
}
The webhook URL can be created and retrieved via the Discord channel server Webhooks settings. The notification needs the full URL which looks like
https://discordapp.com/api/webhooks/1234567890123456789/1Px6cK9-9346g0CbOYArYjr1jj6X9rvRcCpRi3s7HePN0POeCSvuF1Iagb-Wjiq78BnT
You may now send notifications through Laravel to Discord webhooks using the via method.
use SnoerenDevelopment\DiscordWebhook\DiscordMessage;
use SnoerenDevelopment\DiscordWebhook\DiscordWebhookChannel;
class DiscordNotification extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable The notifiable model.
* @return array
*/
public function via($notifiable)
{
return [DiscordWebhookChannel::class];
}
/**
* Get the Discord representation of the notification.
*
* @param mixed $notifiable The notifiable model.
* @return \SnoerenDevelopment\DiscordWebhook\DiscordMessage
*/
public function toDiscord($notifiable): DiscordMessage
{
return DiscordMessage::create()
->username('My Laravel App')
->content('The message body.')
->avatar('https://domain.com/avatar.jpg')
->tts(false);
}
}
Testing
$ composer test
Credits
License
The MIT license. See LICENSE for more information.