PHPackages                             thekonz/lighthouse-redis-broadcaster - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. thekonz/lighthouse-redis-broadcaster

AbandonedArchivedLibrary[Queues &amp; Workers](/categories/queues)

thekonz/lighthouse-redis-broadcaster
====================================

A lighthouse-php redis broadcaster to be used with laravel-echo-server.

1.0.1(6y ago)7622[1 issues](https://github.com/thekonz/lighthouse-redis-broadcaster/issues)[2 PRs](https://github.com/thekonz/lighthouse-redis-broadcaster/pulls)MITPHPPHP &gt;=7.2

Since May 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/thekonz/lighthouse-redis-broadcaster)[ Packagist](https://packagist.org/packages/thekonz/lighthouse-redis-broadcaster)[ RSS](/packages/thekonz-lighthouse-redis-broadcaster/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (4)Used By (0)

Lighthouse Redis Broadcaster [![Build Status](https://camo.githubusercontent.com/3599248cea1e8f000dd449a2456a7c1fbb0f1b0978223a6072013f7196c0c6c5/68747470733a2f2f7472617669732d63692e6f72672f7468656b6f6e7a2f6c69676874686f7573652d72656469732d62726f61646361737465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thekonz/lighthouse-redis-broadcaster)
========================================================================================================================================================================================================================================================================================================================================================================

[](#lighthouse-redis-broadcaster-)

[Lighthouse](https://lighthouse-php.com/) already supports pusher, but does not deliver its own redis based solution. This package enables graphql subscriptions using presence channels of the [laravel-echo-server](https://github.com/tlaverdure/laravel-echo-server).

For a client solution, check out the [Apollo Lighthouse Subscription Link](https://github.com/thekonz/apollo-lighthouse-subscription-link).

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

[](#installation)

*I assume that you already have [Lighthouse](https://lighthouse-php.com/) and [laravel-echo-server](https://github.com/tlaverdure/laravel-echo-server) installed. If not, please check out their installation steps before continuing.*

Install the package with composer:

```
composer require thekonz/lighthouse-redis-broadcaster
```

Add the service provider **after** the Lighthouse subscription service provider in the `config/app.php`:

```
        /*
         * Package Service Providers...
         */
        \Nuwave\Lighthouse\Subscriptions\SubscriptionServiceProvider::class,
        \thekonz\LighthouseRedisBroadcaster\SubscriptionServiceProvider::class,
```

Add this to your `.env`:

```
LIGHTHOUSE_BROADCASTER=redis
REDIS_PREFIX=
```

If you do not set the `REDIS_PREFIX` to empty, it will default to `_database_` (by default: `laravel_database_`) and all redis channels will be prefixed with it.

Setting up automatic removal of subscription channels
-----------------------------------------------------

[](#setting-up-automatic-removal-of-subscription-channels)

Lighthouse by default does not remove vacated channels. In order to prevent redis from running low on memory all the time, you need to configure the laravel-echo-server to publish updates about its presence channels and run a subscriber that removes vacated channels from redis.

Enable presence channel updates in your `laravel-echo-server.json` by setting `publishPresence` to `true`:

```
  "databaseConfig": {
    ...
    "publishPresence": true
  }
```

Run the subscription command to remove vacated channels:

```
php artisan lighthouse:subscribe
```

Usage
-----

[](#usage)

*If you are using Apollo, you should use the [Apollo Lighthouse Subscription Link](https://github.com/thekonz/apollo-lighthouse-subscription-link).*

Create a subscription as described in the [Lighthouse docs](https://lighthouse-php.com/4.12/subscriptions/defining-fields.html). For the purpose of demonstration, I assume the subscription is `postUpdated` like in the docs.

Now query the api:

```
subscription test {
  postUpdated {
    id
    title
  }
}
```

The response will be:

```
{
  "data": {
    "postUpdated": null
  },
  "extensions": {
    "lighthouse_subscriptions": {
      "version": 1,
      "channels": {
        "test": "private-lighthouse-9RrjQE84nqaxXt58ZsgREPaI9AxGjAv4-1588101712"
      }
    }
  }
}
```

Now you may use laravel echo to monitor the subscription as a presence channel:

```
Echo.join(
  "private-lighthouse-9RrjQE84nqaxXt58ZsgREPaI9AxGjAv4-1588101712"
).listen(".lighthouse.subscription", ({ channel, data }) => {
  console.log(channel); // private-lighthouse-9RrjQE84nqaxXt58ZsgREPaI9AxGjAv4-1588101712
  console.log(data); // { postUpdated: { id: 1, title: "New title" } }
});
```

Contributing and issues
-----------------------

[](#contributing-and-issues)

Feel free to contribute to this package using the issue system and pull requests on the `develop` branch.

Automated unit tests must be added or changed to cover your changes or reproduce bugs.

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

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

2284d ago

### Community

Maintainers

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

---

Top Contributors

[![thekonz](https://avatars.githubusercontent.com/u/2700089?v=4)](https://github.com/thekonz "thekonz (44 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thekonz-lighthouse-redis-broadcaster/health.svg)

```
[![Health](https://phpackages.com/badges/thekonz-lighthouse-redis-broadcaster/health.svg)](https://phpackages.com/packages/thekonz-lighthouse-redis-broadcaster)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k16.3M154](/packages/laravel-pulse)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M318](/packages/laravel-ai)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)

PHPackages © 2026

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