Search by

triztan / laravel-discord-notifier

OmegaHUN

A lightweight and production-ready Laravel package to dispatch error logs and notifications to Discord via Webhooks.

Package info

github.com/OmegaHUN/laravel-discord-notifier

pkg:composer/triztan/laravel-discord-notifier

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-10-01 10:58 UTC

This package is auto-updated.

Last update: 2026-11-01 08:14:28 UTC


README

Latest Version on Packagist License

A lightweight, zero-dependency Laravel package to instantly dispatch error logs, exceptions, and system notifications directly to your Discord channel via Webhook.

πŸš€ Need Enterprise-Grade Features? Check out the PRO Edition!

If you are working on a high-traffic or large-scale project and need advanced capabilities, upgrade to the Laravel Discord Notifier PRO (Enterprise Edition) package, which includes:

  • 🎨 Advanced Rich Embed Builder (DTO): Send detailed, color-coded, customized Discord cards with fields and footers.
  • ⚑ Asynchronous Queue Background Jobs (SendDiscordNotificationJob): Non-blocking dispatching so your HTTP requests stay lightning fast.
  • πŸͺ΅ Native Monolog Logger Driver: Seamlessly integrates into Laravel's logging stack to automatically push critical application errors to Discord.
  • 🚦 Built-in Rate-Limiting: Intelligently prevents hitting Discord API limits (avoiding 429 Too Many Requests errors).
  • βš™οΈ Extended Configuration & Facade Support: Full control via the DiscordPro Facade.

πŸ‘‰ Get the PRO Edition on Gumroad ($11.27)

Installation

You can install the package via composer into your local development or production project:

```bash composer require triztan/laravel-discord-notifier ```

Publish the configuration file using Artisan:

```bash php artisan vendor:publish --tag="discord-config" ```

Add your Discord Webhook URL to your application's `.env` file:

```env DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your-webhook-id/your-webhook-token DISCORD_NOTIFIER_ENABLED=true ```

Usage

You can easily send custom messages anywhere in your Laravel application using the Facade:

```php use Triztan\DiscordNotifier\Facades\Discord;

// Send a simple notification Discord::send('User signup failed due to a database timeout!'); ```

Integrating with Laravel Exception Handler (bootstrap/app.php or app/Exceptions/Handler.php)

To automatically catch and report critical application exceptions to Discord:

```php use Triztan\DiscordNotifier\Facades\Discord; use Throwable;

// Inside your reportable callback: $this->reportable(function (Throwable $e) { Discord::send("Critical Error: " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine()); }); ```

Testing

To run the package tests locally:

```bash vendor/bin/phpunit ```

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

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