PHPackages                             louisgjbertrand/discordwebhook - 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. louisgjbertrand/discordwebhook

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

louisgjbertrand/discordwebhook
==============================

1.0.0(3y ago)112PHP

Since Jan 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LouisGJBertrand/DiscordWebhook)[ Packagist](https://packagist.org/packages/louisgjbertrand/discordwebhook)[ RSS](/packages/louisgjbertrand-discordwebhook/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Discord Webhook Sender
======================

[](#discord-webhook-sender)

A simple &amp; lightweight webhook sender.

Based on the code from this Stack exchange answer, this library is a lightweight Discord Webhook Event Sender that comes with two main functions.

---

Installation
============

[](#installation)

run the following command in your project

```
composer require louisgjbertrand/discordwebhook
```

---

Usage
=====

[](#usage)

Requirements
------------

[](#requirements)

the buit-in CURL Library is required. please uncomment the curl library in your php.ini file

```
# in the php.ini file
extension=curl
```

require the class in the php script you need it in.

```
require './vendor/autoload.php';

use LouisGJBertrand\DiscordWebhook\DiscordWebhook;
```

Sending the event
-----------------

[](#sending-the-event)

you just have to use the Send function to send a message. only the url is required in this function.

you can use a pointer to store the json response from the discord api using the response param.

```
DiscordWebhook::Send($webhookurl, content: $content, response: $response);
```

not all parameters are supported in the current state, but will be added later. It's mapping the discord webhook api.

```
static public function Send(
        string $webhookurl,
        string $content = null,
        string $username = null,
        string $avatar_url = null,
        bool $tts = false,
        array $embeds = null,
        string &$response = null)
```

note: tts is text to speech.

Generating embeded messages
---------------------------

[](#generating-embeded-messages)

you can create an array in order to create an embeded message using this function

```
$embed = DiscordWebhook::GenerateEmbed(title: "test", description: "test embeded message");
$embeds = [$embed];
```

putting the embeded message in an array is necessary since it's asked in the [discord webhook documentation](https://discord.com/developers/docs/resources/webhook). the maximum embeded messages by webhook events is 10.

the function, to generate an embeded message follows the discord documentation.

```
static public function GenerateEmbed(
        string $title = null,
        string $type = null,
        string $description = null,
        string $url = null,
        int $timestamp = null,
        int $color= null,
        array $footer= null,
        array $image= null,
        array $thumbnail= null,
        array $video= null,
        array $provider= null,
        array $author= null,
        array $fields= null): array
```

in the future, arrays will be replaced by discord api objects but will still remain retro compatible.

---

Example Script
==============

[](#example-script)

you can find this example script in the tests/ folder.

```
require './vendor/autoload.php';

use LouisGJBertrand\DiscordWebhook\DiscordWebhook;

// Replace with the webhook url
$webhookurl = "https://discord.com/api/webhooks/.../...";

$embed = DiscordWebhook::GenerateEmbed(title: "test", description: "test embeded message");
$embeds = [$embed];

DiscordWebhook::Send($webhookurl, embeds: $embeds, response: $response);

// returns the response from the Discord API
var_dump($response);
```

Notes
=====

[](#notes)

this library does not use ssl verification for curl by default. Please set the secure flag in the static variable `DiscordWebhook::$SECURE_CURL_CONNECTION` to true in order to use SSL verification for CURL.

External Ressources
===================

[](#external-ressources)

[1 - composer documentation](https://getcomposer.org/doc/)[2 - Discord Webhook Documentation](https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params)[3 - Discord Embeded Message Documentation](https://discord.com/developers/docs/resources/channel#embed-object)[4 - Stack Exchange Discord Webhook Original Post](https://stackoverflow.com/questions/59219193/how-can-i-send-a-discord-webhook-using-php)

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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 ~0 days

Total

2

Last Release

1251d ago

Major Versions

0.0.0 → 1.0.02023-01-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f11493d5fb68407a65bc6e336fe763f3eb7abfefa85d8133ae1bc1942469e11?d=identicon)[PYLOTT](/maintainers/PYLOTT)

---

Top Contributors

[![LouisGJBertrand](https://avatars.githubusercontent.com/u/19841744?v=4)](https://github.com/LouisGJBertrand "LouisGJBertrand (2 commits)")

### Embed Badge

![Health badge](/badges/louisgjbertrand-discordwebhook/health.svg)

```
[![Health](https://phpackages.com/badges/louisgjbertrand-discordwebhook/health.svg)](https://phpackages.com/packages/louisgjbertrand-discordwebhook)
```

###  Alternatives

[appwilio/russianpost-sdk

Russian Post (pochta.ru) SDK

4515.7k](/packages/appwilio-russianpost-sdk)[luchavez/boilerplate-generator

A boilerplate generator for building packages and implementing DDD on Laravel 8|9|10.

121.7k2](/packages/luchavez-boilerplate-generator)

PHPackages © 2026

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