Skip to main content

Overview

revolution/laravel-notification-discord-webhook is a Laravel notification channel that delivers notifications to Discord using Webhooks. Discord’s official Bot API requires maintaining a persistent WebSocket connection, which adds complexity to your setup. With a Webhook, you only need a URL — no Bot token, no gateway, no background process. If your goal is simply to notify a Discord channel about application events, a Webhook is the right tool for the job.
This package requires PHP 8.3 or higher and Laravel 12.0 or higher.

Installation

Configuration

Get a Webhook URL from Discord

Create a Webhook URL from your Discord server’s Settings → Integrations → Webhooks. See the Discord official guide for detailed instructions.

config/services.php

.env

Basic usage

Create a Notification class

Implement the toDiscordWebhook() method and return DiscordChannel::class from via().

Sending notifications

On-Demand notification

Use Notification::route() to send a notification without tying it to a specific notifiable model.

Notification from a User model

To support per-user Webhook URLs, define routeNotificationForDiscordWebhook() on your model.

Message types

Text message

The simplest way to send a message.

Embed message

Use DiscordEmbed to create a rich embed with a title, description, and URL.

File attachment

Use DiscordAttachment to attach a file. Both content (raw file bytes) and filename are required.

Referencing attachments in an embed

You can reference an attached file inside an embed’s image or thumbnail using the attachment://filename syntax.

Send any payload

Use ->with() to pass arbitrary parameters directly to the Discord Webhook API.
For all available parameters, refer to the Discord Webhook API documentation.

Summary

A Discord Bot is powerful but overkill when you only need to send notifications. With this package, you can integrate Discord notifications into the standard Laravel notification system in minutes — no Bot token, no gateway connection, just a Webhook URL and a Notification class.
For the latest information, refer to the GitHub repository.
Last modified on April 29, 2026