Download the PHP package thekonz/lighthouse-redis-broadcaster without Composer

On this page you can find all versions of the php package thekonz/lighthouse-redis-broadcaster. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lighthouse-redis-broadcaster

Lighthouse Redis Broadcaster Build Status

Lighthouse 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.

For a client solution, check out the Apollo Lighthouse Subscription Link.

Installation

I assume that you already have Lighthouse and laravel-echo-server installed. If not, please check out their installation steps before continuing.

Install the package with composer:

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

Add this to your .env:

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

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:

Run the subscription command to remove vacated channels:

Usage

If you are using Apollo, you should use the Apollo Lighthouse Subscription Link.

Create a subscription as described in the Lighthouse docs. For the purpose of demonstration, I assume the subscription is postUpdated like in the docs.

Now query the api:

The response will be:

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

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.


All versions of lighthouse-redis-broadcaster with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
nuwave/lighthouse Version ^4
illuminate/support Version ^7.7
illuminate/console Version ^7.7
illuminate/cache Version ^7.7
illuminate/redis Version ^7.7
illuminate/broadcasting Version ^7.7
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package thekonz/lighthouse-redis-broadcaster contains the following files

Loading the files please wait ....