PHPackages                             livaco/easydiscordwebhook - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. livaco/easydiscordwebhook

ActiveLibrary[HTTP &amp; Networking](/categories/http)

livaco/easydiscordwebhook
=========================

An simple, lightweight, easy to use library to allow you to create and send discord webhooks in PHP.

2.0.0(3y ago)7143Apache-2.0PHP

Since Oct 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LivacoNew/EasyDiscordWebhook)[ Packagist](https://packagist.org/packages/livaco/easydiscordwebhook)[ Docs](https://github.com/LivacoNew/EasyDiscordWebhook)[ RSS](/packages/livaco-easydiscordwebhook/feed)WikiDiscussions master Synced 2d ago

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

EasyDiscordWebhook
==================

[](#easydiscordwebhook)

EasyDiscordWebhook is a simple, easy to use library to allow you to create and send discord webhooks in PHP with minimal effort.

Installation
------------

[](#installation)

EasyDiscordWebhook can be installed just like any other composer package.
`composer require livaco\easydiscordwebhook`

Usage
-----

[](#usage)

To get started, we'll start by making a `DiscordWebhook` object. This is done as such.

```
$webhook = DiscordWebhook::new("https://discord.com/api/webhooks/your/webhook");
```

The argument in the `new` function is for your webhook url.
Next, we can begin setting what our webhook should contain. Every webhook requires either text in the content, or at least one embed.
We'll keep it simple for now though, and just have it say o'l "Hello, world!". EasyDiscordWebhook supports fluent interface, so we'll use that as well and get rid of the `$webhook` variable.
To set the content of the webhook, we'll use the `setContent` function. To send it, you from here just need to call the `execute` function.

```
DiscordWebhook::new("https://discord.com/api/webhooks/your/webhook")
    ->setContent("Hello, world!")
    ->execute();
```

[![The webhook that was sent](https://camo.githubusercontent.com/e4a7ec2462d0991b060b7e08e3f78be5a85c35675482b8f9bc1df4d89b700782/68747470733a2f2f75706c6f61642e6c697661636f2e6465762f752f3043455154384d476f572e706e67)](https://camo.githubusercontent.com/e4a7ec2462d0991b060b7e08e3f78be5a85c35675482b8f9bc1df4d89b700782/68747470733a2f2f75706c6f61642e6c697661636f2e6465762f752f3043455154384d476f572e706e67)

Cool, right? Let's add an embed now. Let's pretend it's a game information webhook, and we want some basic information about Cyberpunk 2077 (I suck at examples, so this is the best I got).
Embeds are added using the `addEmbed` function. From there, we can feed it an embed object that has all the information attached to it. Once again, we create this object using `Embed::new()` and from there we can use the functions provided to fill out the data.

```
DiscordWebhook::new("https://discord.com/api/webhooks/your/webhook")
    ->addEmbed(Embed::new()
        ->setTitle("Cyberpunk 2077")
        ->setDescription("Cyberpunk 2077 is an open-world, action-adventure RPG set in the megalopolis of Night City, where you play as a cyberpunk mercenary wrapped up in a do-or-die fight for survival. Improved and featuring all-new free additional content, customize your character and playstyle as you take on jobs, build a reputation, and unlock upgrades. The relationships you forge and the choices you make will shape the story and the world around you. Legends are made here. What will yours be?")
        ->addField("Release Date", "December 10, 2020", true)
        ->addField("Platforms", "All Major Platforms", true)
        ->addField("Developer", "CD Projekt Red", true)
        ->setColor("#FCFF2B")
        ->setUrl("https://www.cyberpunk.net/gb/en/")
        ->setImage("https://upload.livaco.dev/u/nYLGepk6X2.png")
    )
    ->execute();
```

[![The webhook that was posted](https://camo.githubusercontent.com/52a0cc9744d5814966dec5f9f53cff997fbb12880d1a12a12555381408aefe20/68747470733a2f2f75706c6f61642e6c697661636f2e6465762f752f50727755335967664d572e706e67)](https://camo.githubusercontent.com/52a0cc9744d5814966dec5f9f53cff997fbb12880d1a12a12555381408aefe20/68747470733a2f2f75706c6f61642e6c697661636f2e6465762f752f50727755335967664d572e706e67)

If you want more examples, take a look in /examples.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

1213d ago

Major Versions

1.0.2 → 2.0.02023-01-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc67128838e19100f47595d119ef0a2c2df0f748d1de216a8bdb1f7141235593?d=identicon)[Livaco](/maintainers/Livaco)

---

Top Contributors

[![LivacoNew](https://avatars.githubusercontent.com/u/51921257?v=4)](https://github.com/LivacoNew "LivacoNew (19 commits)")

---

Tags

composerdiscordlibraryphpwebhookphpwebhookdiscord

### Embed Badge

![Health badge](/badges/livaco-easydiscordwebhook/health.svg)

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

###  Alternatives

[renoki-co/laravel-aws-webhooks

Easy webhook handler for Laravel to catch AWS SNS notifications for various services.

73248.5k](/packages/renoki-co-laravel-aws-webhooks)[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76410.4k1](/packages/hannesvdvreken-guzzle-debugbar)[skrepr/teams-connector

A simple PHP package for sending messages to Microsoft Teams

239.6k1](/packages/skrepr-teams-connector)[atakde/discord-webhook-php

discord webhook php

186.5k](/packages/atakde-discord-webhook-php)

PHPackages © 2026

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