PHPackages                             jbdabes/discord-webhooks - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jbdabes/discord-webhooks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jbdabes/discord-webhooks
========================

Use Discord webhooks with ease.

1.1.0(5y ago)3251MITPHPPHP ^7.2|^8.0CI failing

Since Feb 14Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jbdabes/discord-webhooks)[ Packagist](https://packagist.org/packages/jbdabes/discord-webhooks)[ RSS](/packages/jbdabes-discord-webhooks/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

Discord-Webhooks
================

[](#discord-webhooks)

*Use Discord's webhook feature with ease!*

What are webhooks?
------------------

[](#what-are-webhooks)

From Discord's documentation:

> Discord's built in Webhooks function as an easy way to get automated messages and data updates sent to a text channel in your server. Think of them as one of those fancy pneumatic tube things you used to love sending money into at a bank and watch disappear, but instead of never seeing your money again, you're actually sending messages into Discord from another platform.

What does this library do?
--------------------------

[](#what-does-this-library-do)

Previously, in order to send some data to a Discord webhook, you would need to write the JSON code manually, or structure the data yourself, fire it off with curl/some other method, and so on. The code to do so isn't developer friendly and can be confusing to amateurs.

The aim of this library is to *simplify* the usage of webhooks so that everyone can leverage their power.

Take the following as an example:

```
$webhookURL = "https://discordapp.com/api/webhooks/my-webhook-url";

$jsonData = [
    "embeds" => [
        [
            "title" => "My Webhook Title",
            "description" => "My Webhook Description",
            "url" => "https://playersquared.com",
            "color" => 4433631,
            "timestamp" => date("Y-m-d\\TH:i:s.u\\Z"),
            "thumbnail" => [
                "url" => "https://cdn.discordapp.com/embed/avatars/0.png",
            ],
            "author" => [
                "name" => "JB",
                "url" => "https://playersquared.com/forums/members/jb/",
                "icon_url" => "https://cdn.discordapp.com/embed/avatars/4.png",
            ]
        ]
    ]
];

$ch = curl_init($webhookURL);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($jsonData));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

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

Now, the same code with Discord-Webhooks:

```
$webhook = new \DiscordWebhooks\Webhook("https://discordapp.com/api/webhooks/my-webhook-url");
$embed   = new \DiscordWebhooks\Embeds\Embed();

$embed->setTitle("My Webhook Title")
    ->setDescription("My Webhook Description")
    ->setUrl("https://playersquared.com")
    ->setColor("#43a6df")
    ->setTimestamp($webhook->currentTimestamp());

$embed->thumbnail()->setUrl("https://cdn.discordapp.com/embed/avatars/0.png");
$embed->author()->setName("JB")
    ->setUrl("https://playersquared.com/forums/members/jb/")
    ->setIconUrl("https://cdn.discordapp.com/embed/avatars/4.png");

$webhook->embeds()->add($embed);
$webhook->send();
```

Working with Discord's webhooks has never been this simple.

How can I use this library?
---------------------------

[](#how-can-i-use-this-library)

Discord-Webhooks can be installed to your PHP project by using composer:

`composer require jbdabes/discord-webhooks`

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~412 days

Total

2

Last Release

1864d ago

PHP version history (2 changes)v1.0.0PHP ^7.2

1.1.0PHP ^7.2|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5009097?v=4)[JB](/maintainers/jbdabes)[@jbdabes](https://github.com/jbdabes)

---

Top Contributors

[![jbdabes](https://avatars.githubusercontent.com/u/5009097?v=4)](https://github.com/jbdabes "jbdabes (7 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jbdabes-discord-webhooks/health.svg)

```
[![Health](https://phpackages.com/badges/jbdabes-discord-webhooks/health.svg)](https://phpackages.com/packages/jbdabes-discord-webhooks)
```

###  Alternatives

[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[bubbstore/correios

Biblioteca que faz cálculo de frete, rastreamento de objetos e consulta de CEP diretamente do Webservice dos Correios.

2589.0k](/packages/bubbstore-correios)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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