Download the PHP package emprove/centrifuge-broadcaster without Composer
On this page you can find all versions of the php package emprove/centrifuge-broadcaster. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emprove/centrifuge-broadcaster
More information about emprove/centrifuge-broadcaster
Files in emprove/centrifuge-broadcaster
Package centrifuge-broadcaster
Short Description Centrifuge broadcaster for laravel ^6
License MIT
Homepage https://github.com/emprove/centrifuge-broadcaster
Informations about the package centrifuge-broadcaster
Attention! Maybe some diff with IRL.
- This package forked from "LaraComponents" to fit new Centrifugo v2.
- Drop Redis support (v2 don't support it), see official migration guide.
- Update generateToken(user id, timestamp, info) method (v2 uses only jwt auth workflow).
Introduction
Centrifuge broadcaster for laravel ^6
Requirements
- PHP 7.2+
- Laravel 6+
- Centrifugo Server 2 or newer (see here)
Installation
Require this package with composer:
Open your config/app.php and add the following to the providers array:
Open your config/broadcasting.php and add the following to it:
You can also add a configuration to your .env file:
Do not forget to install the broadcast driver
Basic Usage
To configure the Centrifugo server, read the official documentation
For broadcasting events, see the official documentation of laravel
A simple example of using the client:
Available methods
Name | Description |
---|---|
publish(string $channel, array $data, string $client = null) | Send message into channel. |
broadcast(array $channels, array $data, string $client = null) | Send message into multiple channel. |
presence(string $channel) | Get channel presence information (all clients currently subscribed on this channel). |
history(string $channel) | Get channel history information (list of last messages sent into channel). |
unsubscribe(string $user_id, string $channel = null) | Unsubscribe user from channel. |
disconnect(string $user_id) | Disconnect user by its ID. |
channels() | Get channels information (list of currently active channels). |
stats() | Get stats information about running server nodes. |
generateToken(string $userId) | Generate JWT token for client. |
generateApiSign(string $data) | Generate api sign. |
License
The MIT License (MIT). Please see License File for more information.
All versions of centrifuge-broadcaster with dependencies
illuminate/broadcasting Version ^6.0
guzzlehttp/guzzle Version ^6.3.3
lcobucci/jwt Version 3.4.*