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. thekonz/lighthouse-redis-broadcaster

AbandonedArchivedLibrary

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

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

1.0.1(6y ago)8622[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 3d ago

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

27

—

LowBetter than 49% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity16

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

2190d 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

[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)

PHPackages © 2026

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