PHPackages                             justinkluever/discord-webhook-builder - 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. justinkluever/discord-webhook-builder

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

justinkluever/discord-webhook-builder
=====================================

a simple and fluent builder for discord webhook messages with embeds or components v2

v0.1.0(today)02↑2900%MITPHPPHP ^8.3

Since Jun 13Pushed todayCompare

[ Source](https://github.com/justinkluever/discord-webhook-builder)[ Packagist](https://packagist.org/packages/justinkluever/discord-webhook-builder)[ Docs](https://github.com/justinkluever/discord-webhook-builder)[ RSS](/packages/justinkluever-discord-webhook-builder/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Discord Webhook Builder
=======================

[](#discord-webhook-builder)

A simple discord webhook builder.

This package only provides a fluent way of building the payload, you still have to send it yourself currently.

Note

Components that are not supported by the simple discord webhook endpoint may be missing or limited currently as they where not the primary goal of this package

you can install it via composer:

```
composer require justinkluever/discord-webhook-builder
```

Usage
-----

[](#usage)

Using this package should be simple:

```
use JustinKluever\DiscordWebhookBuilder\Components\TextDisplay;
use JustinKluever\DiscordWebhookBuilder\Enums\Support\MessageFlag;
use JustinKluever\DiscordWebhookBuilder\Support\Webhook\Embed;
use JustinKluever\DiscordWebhookBuilder\Webhook;

// Components V2
$webhook = Webhook::make()
    ->flag(MessageFlag::IS_COMPONENTS_V2) // Required for Components V2 by Discord
    ->component(
        TextDisplay::make('This is a Text Display!'),
    );

// Classic Webhooks
$webhook = Webhook::make()
    ->content('Embed Test webhook')
    ->embed(
        Embed::make()->description('This is a Embed description'),
    )
```

After creating your webhook payload you can use your preferred way of POSTing:

```
// Laravel HTTP Client
use Illuminate\Support\Facades\Http;
Http::post('https://discord.com/api/webhooks/...', $webhook); // The Webhook builder implements Stringable for ease of use

// Guzzle
$client->post('https://discord.com/api/webhooks/...', [
    'json' => $webhook
]);

// cURL
$ch = curl_init('https://discord.com/api/webhooks/...');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $webhook);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);
```

For more details on how to use specific Components check the Source or look at Discord's Documentation:

- [Discord Webhook Documentation](https://docs.discord.com/developers/resources/webhook)
- [Discord Components Documentation](https://docs.discord.com/developers/components/reference#component-object)

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19864478?v=4)[Justin K.](/maintainers/justinkluever)[@justinkluever](https://github.com/justinkluever)

---

Tags

buildercomponentsdiscorddtodxembedfluentnotificationpackagepayloadphpsimplewebhookphpnotificationbuilderfluentwebhookcomponentpayloaddtoembeddiscorddiscord-webhookcomponents-v2

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/justinkluever-discord-webhook-builder/health.svg)

```
[![Health](https://phpackages.com/badges/justinkluever-discord-webhook-builder/health.svg)](https://phpackages.com/packages/justinkluever-discord-webhook-builder)
```

###  Alternatives

[laravel-notification-channels/discord

Laravel notification driver for Discord.

2401.4M13](/packages/laravel-notification-channels-discord)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NotifyX、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

687111.2k8](/packages/guanguans-notify)[snoeren-development/laravel-discord-webhook-channel

Send notifications to a Discord webhook.

1653.0k1](/packages/snoeren-development-laravel-discord-webhook-channel)[agorlov/discordmsg

Little class to send Discord message

1155.4k](/packages/agorlov-discordmsg)[tomatophp/filament-twilio

Send Whatsapp messages using Twilio and native filament Notification Facade class

112.4k](/packages/tomatophp-filament-twilio)

PHPackages © 2026

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