PHPackages                             laravel54-notification-channels/discord - 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. laravel54-notification-channels/discord

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

laravel54-notification-channels/discord
=======================================

Laravel notification driver for Discord.

v1.0.0(8y ago)051MITPHPPHP &gt;=5.6.4

Since Aug 16Pushed 8y agoCompare

[ Source](https://github.com/BennySama/Discord-Notification-Laravel-5.4)[ Packagist](https://packagist.org/packages/laravel54-notification-channels/discord)[ Docs](https://github.com/laravel-notification-channels/discord)[ RSS](/packages/laravel54-notification-channels-discord/feed)WikiDiscussions master Synced 2w ago

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

Discord notification channel for Laravel 5.3
============================================

[](#discord-notification-channel-for-laravel-53)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d6f73186aedceefb05a32ad030d3decc8ee783a830963022c064e87c57507504/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f646973636f72642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/discord)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/db8548320a78952794f4cd7b01bb6c8225d0a329abfc41d2f68332f3e61f0c85/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f646973636f72642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/discord)[![StyleCI](https://camo.githubusercontent.com/93fd577392d2966d95a8bc9922da4a06d8c381e5b83efaa02d4089bda35dfff0/68747470733a2f2f7374796c6563692e696f2f7265706f732f36353737323439322f736869656c64)](https://styleci.io/repos/65772492)[![SensioLabsInsight](https://camo.githubusercontent.com/b26ea9ab73b23ae17e06f99a29d4fd28dc545376ffb7331a905f6c0d11ebb85b/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f31393962306664662d303732652d346465302d393965362d3739383137633938643962372e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/199b0fdf-072e-4de0-99e6-79817c98d9b7)[![Quality Score](https://camo.githubusercontent.com/6a1209cfc5870e5bf723e60b8eec1b3469efcbcf945a051fae07f4ab991e5df0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f646973636f72642e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/discord)[![Code Coverage](https://camo.githubusercontent.com/f5641469f94960c6475f5a730fc98576374dab7633e6e1573ef8a716078eb1e7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f646973636f72642f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/discord/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/2c966d30257e2a768b755c544e9047bfe1f11458c525160501009e8bf48a6eef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f646973636f72642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/discord)

This package makes it easy to send notifications using the [Discord bot API](https://discordapp.com/developers/docs/intro) with Laravel 5.3.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up your Discord bot](#setting-up-your-discord-bot)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require laravel-notification-channels/discord
```

Next, you must load the service provider:

```
// config/app.php
'providers' => [
    // ...
    NotificationChannels\Discord\DiscordServiceProvider::class,
],
```

### Setting up your Discord bot

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

1. [Create a Discord application.](https://discordapp.com/developers/applications/me/create)
2. Click the `Create a Bot User` button on your Discord application.
3. Paste your bot's API token, found under `App Bot User`, in your `services.php` config file:

    ```
    // config/services.php
    'discord' => [
        'token' => 'YOUR_API_TOKEN',
    ],
    ```
4. Add the bot to your server and identify it by running the artisan command:

    ```
    php artisan discord:setup
    ```

Usage
-----

[](#usage)

In every model you wish to be notifiable via Discord, you must add a channel ID property to that model accessible through a `routeNotificationForDiscord` method:

```
class Guild extends Eloquent
{
    use Notifiable;

    public function routeNotificationForDiscord()
    {
        return $this->discord_channel;
    }
}
```

> **NOTE**: Discord handles direct messages as though they are a regular channel. If you wish to allow users to receive direct messages from your bot, you will need to create a private channel with that user. An example workflow may look like the following:
>
> 1. Your `users` table has two discord columns: `discord_user` and `discord_channel`
> 2. When a user updates their Discord user ID (`discord_user`), generate and save a channel ID (`discord_channel`)
> 3. Return the user's `discord_channel` in the `routeNotificationForDiscord` method on the User model
>
> You can generate direct message channels by using the `getPrivateChannel` method in `NotificationChannels\Discord\Discord`:
>
> ```
> use NotificationChannels\Discord\Discord;
> // ...
>
> class UserDiscordSettingsController
> {
>     public function store(Request $request)
>     {
>         $user = $request->input('discord_user');
>         $channel = app(Discord::class)->getPrivateChannel($user);
>
>         Auth::user()->update([
>             'discord_user' => $user,
>             'discord_channel' => $channel,
>         ]);
>     }
> }
> ```

You may now tell Laravel to send notifications to Discord channels in the `via` method:

```
// ...
use NotificationChannels\Discord\DiscordChannel;
use NotificationChannels\Discord\DiscordMessage;

class GameChallengeNotification extends Notification
{
    public $challenger;

    public $game;

    public function __construct(Guild $challenger, Game $game)
    {
        $this->challenger = $challenger;
        $this->game = $game;
    }

    public function via($notifiable)
    {
        return [DiscordChannel::class];
    }

    public function toDiscord($notifiable)
    {
        return DiscordMessage::create("You have been challenged to a game of *{$this->game->name}* by **{$this->challenger->name}**!");
    }
}
```

### Available Message methods

[](#available-message-methods)

- `body(string)`: Set the content of the message. ([Supports basic markdown](https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-))
- `embed(array)`: Set the embedded content. ([View embed structure](https://discordapp.com/developers/docs/resources/channel#embed-object))

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)

- [Cody Scott](https://github.com/codyphobe)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 65.5% 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 ~363 days

Total

2

Last Release

3242d ago

Major Versions

0.0.1 → v1.0.02017-08-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24943944?v=4)[BennySama](/maintainers/BennySama)[@BennySama](https://github.com/BennySama)

---

Top Contributors

[![codyphobe](https://avatars.githubusercontent.com/u/207072?v=4)](https://github.com/codyphobe "codyphobe (38 commits)")[![BennySama](https://avatars.githubusercontent.com/u/24943944?v=4)](https://github.com/BennySama "BennySama (8 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (8 commits)")[![messerli90](https://avatars.githubusercontent.com/u/3306651?v=4)](https://github.com/messerli90 "messerli90 (2 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (1 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (1 commits)")

---

Tags

laravelnotificationdriverdiscordchannel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/laravel54-notification-channels-discord/health.svg)

```
[![Health](https://phpackages.com/badges/laravel54-notification-channels-discord/health.svg)](https://phpackages.com/packages/laravel54-notification-channels-discord)
```

###  Alternatives

[laravel-notification-channels/discord

Laravel notification driver for Discord.

2401.4M14](/packages/laravel-notification-channels-discord)[spatie/laravel-health

Monitor the health of a Laravel application

87511.3M155](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M123](/packages/roots-acorn)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M529](/packages/laravel-boost)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M169](/packages/laravel-ai)

PHPackages © 2026

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