PHPackages                             esplora/serenade - 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. esplora/serenade

ActiveLibrary

esplora/serenade
================

Server-Sent Events

21.6kPHP

Since Sep 1Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

Serenade
========

[](#serenade)

Serenade is a Laravel package for easily adding [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) to your application. With Serenade, you can quickly and easily stream updates and events in real-time to your users, without the need for additional libraries or external dependencies.

Features
--------

[](#features)

- Simple and easy API for creating and streaming events.
- Compatible with any modern browser that supports Server-Sent Events.
- Full support for Laravel's built-in queuing system for efficient event broadcasting.
- Easily integrate events with Laravel's authentication system.
- Simple configuration and setup for easy integration into your existing Laravel application.

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

[](#installation)

To install Serenade, simply use Composer:

```
composer require esplora/serenade
```

Usage
-----

[](#usage)

Using Serenade is simple and intuitive. Here's an example of how to send a simple event:

```
//...
```

Configure
---------

[](#configure)

All of your application's event broadcasting configuration is stored in the `config/broadcasting.php` configuration file. Add the following lines accordingly:

```
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/

'connections' => [
    'serenade' => [
        'domain'     => '',
        'prefix'     => '',
        'route'      => 'serenade',
        'middleware' => 'web',
    ],
],
```

Subscribing
-----------

[](#subscribing)

Subscribing to updates from a web browser or any other platform supporting Server-Sent Events is straightforward:

```
const url = new URL('https://localhost/.well-known/serenade/your.channel');

const eventSource = new EventSource(url);

// The callback will be called every time an update is published
eventSource.onmessage = e => console.log(e); // do something with the payload
```

This will create a new event with the name example and the message Hello, World!. For more advanced usage, including authorization and queuing, see the official documentation.

License
-------

[](#license)

Serenade is open-sourced software licensed under the MIT license.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c47797b11041f37c2eec74b09bc6619c8997467d690797ebad0e6ab7cb232b7?d=identicon)[tabuna](/maintainers/tabuna)

---

Top Contributors

[![tabuna](https://avatars.githubusercontent.com/u/5102591?v=4)](https://github.com/tabuna "tabuna (13 commits)")[![SadElephant](https://avatars.githubusercontent.com/u/7434276?v=4)](https://github.com/SadElephant "SadElephant (1 commits)")

### Embed Badge

![Health badge](/badges/esplora-serenade/health.svg)

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

PHPackages © 2026

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