PHPackages                             notifycord/notifycord - 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. notifycord/notifycord

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

notifycord/notifycord
=====================

A Laravel package for sending Discord notifications with rich formatting

015PHP

Since Apr 14Pushed 1y agoCompare

[ Source](https://github.com/NotifyCord/NotifyCord)[ Packagist](https://packagist.org/packages/notifycord/notifycord)[ RSS](/packages/notifycord-notifycord/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

 [![NotifyCord Logo](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/notifycord-logo.png)](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/notifycord-logo.png)

NotifyCord
==========

[](#notifycord)

 A powerful and flexible Discord notification package for Laravel

 [![Latest Version on Packagist](https://camo.githubusercontent.com/9e8cdc3cb01c16eb80643916b13cff02e6d947e6b66839cb0843b87047a15078/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f74696679636f72642f6e6f74696679636f72642e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/notifycord/notifycord) [![Total Downloads](https://camo.githubusercontent.com/719c243fb3a25f8155365ae9196b06d32df197ebb25aeb91f89b81381d7286c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e6f74696679636f72642f6e6f74696679636f72642e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/notifycord/notifycord) [![GitHub Repository](https://camo.githubusercontent.com/b6055a13b0b4e11f093d32c83254d59a960556faeb5234d463db18b5b94e7aa2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d4e6f74696679436f72642532464e6f74696679436f72642d626c75653f7374796c653d666f722d7468652d6261646765)](https://github.com/NotifyCord/NotifyCord) [![License](https://camo.githubusercontent.com/daa52099573be5a50c320c4387496400f2f722e49f86a42db8d5778130d3582d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666f722d7468652d6261646765)](https://github.com/NotifyCord/NotifyCord/blob/main/LICENSE.md)

NotifyCord is a powerful and flexible package for sending Discord notifications from your Laravel application. It provides a clean and simple way to send rich Discord messages through channels and webhooks, and integrates perfectly with Laravel's notification system.

---

✨ Features
----------

[](#-features)

- 🔌 Seamless integration with Laravel's Notification system
- 🔗 Support for webhook-based notifications
- 📋 Rich embed message support (title, description, fields, colors, etc.)
- 🔘 Discord components support (buttons, action rows)
- 🔁 Automatic rate limit handling and retries
- 🧩 Queue-compatible for asynchronous notifications
- 🛡️ Error handling with detailed exceptions
- ⚙️ Comprehensive configuration options

📋 Requirements
--------------

[](#-requirements)

- PHP 8.0 or higher
- Laravel 9.0 or higher
- GuzzleHTTP 7.0 or higher

💻 Installation
--------------

[](#-installation)

 [![Installation](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/installation.png)](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/installation.png)

You can install the package via composer:

```
composer require notifycord/notifycord
```

The package will automatically register its service provider if you're using Laravel's package auto-discovery.

If you're using Laravel without auto-discovery, add the service provider to your `config/app.php`:

```
'providers' => [
    // ...
    NotifyCord\NotifyCord\NotifyCordServiceProvider::class,
],

'aliases' => [
    // ...
    'NotifyCord' => NotifyCord\NotifyCord\Facades\NotifyCord::class,
],
```

### Publishing the Configuration

[](#publishing-the-configuration)

You can publish the configuration file with:

```
php artisan vendor:publish --tag="notifycord-config"
```

This will create a `config/notifycord.php` configuration file in your application with the following options:

```
return [
    'default_webhook' => env('DISCORD_WEBHOOK_URL'),
    // 'bot_token' => env('DISCORD_BOT_TOKEN'),  // Not used in webhook-only mode
    'retry_on_rate_limit' => true,
    'retry_on_failure' => true,
    'max_retries' => 3,
    'retry_delay' => 2, // seconds
    'timeout' => 5, // seconds
    'connect_timeout' => 5, // seconds
    'log_errors' => true,
    'log_file' => storage_path('logs/notifycord.log'),  // Custom log file for NotifyCord
    // ...
];
```

### Environment Configuration

[](#environment-configuration)

Add the following to your `.env` file:

```
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/webhook-id/webhook-token

```

📖 Usage Guide
-------------

[](#-usage-guide)

 [![NotifyCord Banner](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/notifycord-banner.png)](https://raw.githubusercontent.com/NotifyCord/NotifyCord/main/examples/notifycord-banner.png)

### 🚀 Laravel Notification System Integration

[](#-laravel-notification-system-integration)

The easiest way to use NotifyCord is through Laravel's notification system. First, create a notification:

```
php artisan make:notification DiscordNotification
```

Then, modify the generated notification class to include a `toDiscord` method:

```
