New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

laravel-notification-channels/discord

Laravel notification driver for Discord.
1,589,005 240

Larablocks Analysis

Compatibility

Trusted maintainer

laravel-notification-channels/discord works with Laravel 7 to 13 (latest release 1.8.0, Mar 17, 2026).

Laravel 5 and 6 in earlier releases.

  • Trusted maintainer: laravel-notification-channels publishes 46 packages on Larablocks, with 3,497,413 downloads a month between them.

Recommendation checks

Recommended

Recommended by Larablocks: meets all 4 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Mar 17, 2026)
  • 42,608 downloads a month (at least 10,000)
  • 240 GitHub stars (at least 100)

State

Maintained
  • Last stable release: Mar 17, 2026.
  • 1 release in the last 12 months.
  • First released: Aug 16, 2016.
  • Monthly downloads: 42,608, up 36% from six months ago.
  • 18 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 30, 2026.

Install
composer require laravel-notification-channels/discord
Latest Version:1.8.0
PHP:^7.2|^8.0
Laravel:7 – 13
Older releases:5 · 6
License:MIT
Last Updated:Mar 17, 2026
Links: GitHub  ·  Packagist

Discord notification channel for Laravel 6.0+

Latest Version on Packagist Software License Build Status StyleCI Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using the Discord bot API with Laravel.

Contents

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

  1. Create a Discord application.

  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

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_id and discord_private_channel_id
  2. When a user updates their Discord user ID (discord_user_id), generate and save a private channel ID (discord_private_channel_id)
  3. Return the user's discord_private_channel_id in the routeNotificationForDiscord method on the User model

You can generate direct message channels by using the getPrivateChannel method in the NotificationChannels\Discord\Discord class

use NotificationChannels\Discord\Discord;

class UserDiscordSettingsController
{
    public function store(Request $request)
    {
        $userId = $request->input('discord_user_id');
        $channelId = app(Discord::class)->getPrivateChannel($userId);

        Auth::user()->update([
            'discord_user_id' => $userId,
            'discord_private_channel_id' => $channelId,
        ]);
    }
}

Please take note that the getPrivateChannel method only accepts Discord's snowflake IDs. There is no API route provided by Discord to lookup a user's ID by their name and tag, and the process for copying and pasting a user ID can be confusing to some users. Because of this, it is recommended to add the option for users to connect their Discord account to their account within your application either by logging in with Discord or linking it to their pre-existing account.

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

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

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

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

Related Packages

snoeren-development/laravel-discord-webhook-channel

Send notifications to a Discord webhook.

61,725 14
mediumart/notifier

Custom hook names for custom laravel notifications channels

81 4
zing/laravel-sms

Provides sms notification channel for Laravel.

5,596 8
puz/laravel-discord-notification

Enables Laravel 5.3 notifications to be sent through discord webhooks.

10 0
liliom/laravel-firebase

Laravel FCM (Firebase Cloud Messaging) Notification Channel

26,400 22

Version History

Version Released PHP Laravel License
1.8.0 ^7.2|^8.0 ^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0|^13.0 MIT
1.7.0 ^7.2|^8.0 ^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0|^12.0 MIT
v1.6.0 ^7.2|^8.0 ^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0 MIT
v1.5.1 ^7.2|^8.0 ^7.0 || ^8.0 || ^9.0 || ^10.0 MIT
v1.5.0 ^7.2|^8.0 ^7.0 || ^8.0 || ^9.0 || ^10.0 MIT