PHPackages                             ccoeder/discord-webhook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. ccoeder/discord-webhook

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

ccoeder/discord-webhook
=======================

Discord Webhook notifications channel for Laravel 5.8

1.1.0(6y ago)02003MITPHPPHP &gt;=7.0.0

Since Aug 20Pushed 6y agoCompare

[ Source](https://github.com/ccoeder/discord-webhook)[ Packagist](https://packagist.org/packages/ccoeder/discord-webhook)[ Docs](https://github.com/ccoeder/discord-webhook)[ RSS](/packages/ccoeder-discord-webhook/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Discord Webhook notifications channel for Laravel 5.3 ~ 5.8
===========================================================

[](#discord-webhook-notifications-channel-for-laravel-53--58)

[![Latest Version on Packagist](https://camo.githubusercontent.com/121e6e5e605b8ba009dfd4d7a9fd286462794665814039235f523874ebadeabb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63636f656465722f646973636f72642d776562686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ccoeder/discord-webhook)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/98dd3d5e1eb843e0b70daf23eee4b07ebdd6c9871b4a4a07a1dc424d2e229e14/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f63636f656465722f646973636f72642d776562686f6f6b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ccoeder/discord-webhook)[![StyleCI](https://camo.githubusercontent.com/768a6041e6d9e1d5da89e64c3e785631240f2736770dfa68d509c42a321135da/68747470733a2f2f7374796c6563692e696f2f7265706f732f3a7374796c655f63695f69642f736869656c64)](https://styleci.io/repos/:style_ci_id)[![SensioLabsInsight](https://camo.githubusercontent.com/7a395d7551140767a9f38f838e0e96b367bae56234402374185cd65ee8d795a1/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f3a73656e73696f5f6c6162735f69642e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/:sensio_labs_id)[![Quality Score](https://camo.githubusercontent.com/9db72a4356bff8bfb06dfac5b384d1193ae6f51f0c90e6dd07adda39208e218c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f63636f656465722f646973636f72642d776562686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ccoeder/discord-webhook)[![Code Coverage](https://camo.githubusercontent.com/7b86d4e31fb04bb24098ab2b4a15ae1b087e6e6fd6d13402be72404efdf0b6f6/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f63636f656465722f646973636f72642d776562686f6f6b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ccoeder/discord-webhook/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/0ffd022ce06189782e72317805d4f5589998e3e5d74ad4bdeb8d2b44330caf3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63636f656465722f646973636f72642d776562686f6f6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ccoeder/discord-webhook)[![Discord](https://camo.githubusercontent.com/e8776d68f00f8c4df22f931ab19935447bfb6dea68aac9db3a2c005c54a3b203/68747470733a2f2f646973636f72646170702e636f6d2f6170692f6775696c64732f3234303534303439363036383437363932382f7769646765742e706e67)](https://discord.gg/9RP6RPg)

This package makes it easy to send notifications using [Discord Webhook](https://support.discordapp.com/hc/en-us/articles/228383668-Using-Webhooks) with Laravel 5.3.

This is a fork from siemenrotensen/discord-webhook because I need to use with on-demand notifications so I added support for that.

Contents
--------

[](#contents)

- [Installation](#installation) - [Setting up the Discord Webhook service](#setting-up-your-discord-webhook)
- [Usage](#usage)
    - [Routing a message](#routing-a-message)
    - [Send a message with embeds](#send-a-message-with-embeds)
    - [Send a message with file upload](#send-a-message-with-file-upload) - [Available Message methods](#available-message-methods) - [Available Embed methods](#available-embed-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ccoeder/discord-webhook
```

### Setting up your Discord Webhook

[](#setting-up-your-discord-webhook)

Follow the official guide [Using Webhook](https://support.discordapp.com/hc/en-us/articles/228383668-Using-Webhooks) to set up your Discord Webhook.

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;
use NotificationChannels\DiscordWebhook\DiscordWebhookMessage;

class Application extends Notification
{
    public function via($notifiable)
    {
        return ['discord-webhook'];
    }

    public function toDiscordWebhook($notifiable)
    {
        return (new DiscordWebhookMessage())
            ->content('Your guild received a new membership application!');
    }
}
```

### Routing a message

[](#routing-a-message)

In order to let your Notification know which Webhook (Discord Channel) you are targeting, add the `routeNotificationForDiscordWebhook` method to your Notifiable model:

```
public function routeNotificationForDiscordWebhook()
{
    return 'https://discordapp.com/api/webhooks/{webhook.id}/{webhook.token}';
}
```

Add `?wait=true` to your Webhook URL, to receive the sent message:

```
return 'https://discordapp.com/api/webhooks/{webhook.id}/{webhook.token}?wait=true';
```

### Send a message with embeds

[](#send-a-message-with-embeds)

Discord Webhook allows you to add embedded rich content to your message:

```
public function toDiscordWebhook($notifiable)
{
    return (new DiscordWebhookMessage())
        ->from('Raid Calendar')
        ->content('**Next Raids**')
        ->embed(function ($embed) {
            $embed->title('Dragon Dungeon')->description('*on Monday*')
                ->field('Raid Leader', 'TheTank', true)
                ->field('Co-Leader', 'HealMePls', true);
        });
}
```

### Send a message with file upload

[](#send-a-message-with-file-upload)

Discord Webhook allows you to upload a file with your message:

```
public function toDiscordWebhook($notifiable)
{
    return (new DiscordWebhookMessage())
        ->content('__Member of the Day:__')
        ->file(\Storage::get('motd_avatar.png'), 'member_of_the_day.png');
}
```

### Available Message methods

[](#available-message-methods)

- `content($text)`: The message contents (up to 2000 characters).
- `from($username[, $avatar_url])`: Override the default username and avatar (optional) of the webhook.
- - `tts()`: Send as a TTS message. (Does currently not work for Webhooks)
- `file($content, $filename)`: The contents of the file being sent. **NOTE:** Does not work with embedded rich content
- `embed($callback)`: Define (up to 10) embedded rich content for the message. (see [Example](#send-a-message-with-embeds) and [Embeds](#available-embed-methods))

### Available Embed methods

[](#available-embed-methods)

- `title($title[, $url])`: Set the title of embed.
- `description($text)`: Set the description of embed.
- `color($color_int)`: Set the color code of the embed.
- `footer($text[, $icon_url])`: Set the footer information.
- `image($img_url)`: Set the image information.
- `thumbnail($img_url)`: Set the thumbnail information.
- `author($name[, $url, $icon_url])`: Set the author information.
- `field($name, $value[, $inline_bool])`: Set the (inline) fields information.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Dr. Dr. Jojo](https://github.com/drdrjojo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09bec2f3198f09287927390c2362f090f0408c319f12fb5285848842b3a5e48c?d=identicon)[ccoeder](/maintainers/ccoeder)

---

Top Contributors

[![hcyildirim](https://avatars.githubusercontent.com/u/10330468?v=4)](https://github.com/hcyildirim "hcyildirim (4 commits)")[![KFC4Life](https://avatars.githubusercontent.com/u/21183888?v=4)](https://github.com/KFC4Life "KFC4Life (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ccoeder-discord-webhook/health.svg)

```
[![Health](https://phpackages.com/badges/ccoeder-discord-webhook/health.svg)](https://phpackages.com/packages/ccoeder-discord-webhook)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/microsoft-teams

A Laravel Notification Channel for Microsoft Teams

1603.0M7](/packages/laravel-notification-channels-microsoft-teams)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[laravel-notification-channels/aws-sns

Amazon Simple Notification Service (AWS SNS) notification channel for Laravel.

541.1M2](/packages/laravel-notification-channels-aws-sns)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
