Download the PHP package denis660/laravel-centrifugo without Composer
On this page you can find all versions of the php package denis660/laravel-centrifugo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download denis660/laravel-centrifugo
More information about denis660/laravel-centrifugo
Files in denis660/laravel-centrifugo
Package laravel-centrifugo
Short Description Centrifugo broadcaster for laravel
License MIT
Homepage https://github.com/denis660/laravel-centrifugo
Informations about the package laravel-centrifugo
Documentation EN | RU
Laravel + Centrifugo
Centrifugo broadcast driver for Laravel 9 - 11
Introduction
Centrifugo broadcaster for Laravel is based on:
Features
- Compatibility with the latest version of Centrifugo v5.4.6 🚀
- Wrapper for Centrifugo HTTP API 🔌
- JWT token authentication (HMAC algorithm) for anonymous, authorized users, and private channels 🗝️
Requirements
- PHP 8.0 - 8.3
- Laravel 9 - 11
- Guzzlehttp/Guzzle 6 - 7
- Centrifugo Server v5 or newer (see here)
Installation
For Laravel 9-10:
For Laravel 11, there are specific instructions below.
Выберите нужную вам версию
Version | PHP | Laravel | Centrifugo | Notes |
---|---|---|---|---|
5.0.* |
>= 8.0 |
9 - 11 |
5 |
Current version |
3.0.* |
>= 7.4 |
8.75.* - 10 |
4 -5 |
Previous version |
By default, broadcasting is disabled in new Laravel 11 applications. You can enable broadcasting using the install Artisan command:
If asked whether to install Reverb, answer “no.”
Then, install the package for working with Centrifugo via composer by running the following command:
Configuration
Run the command centrifuge , which will install centrifuge-laravel with a reasonable set of default configuration options and generate default keys. If you want to make any changes to the configuration, you can update the environment variables in the .env file.
Credentials
To establish a connection with Centrifugo, you need to provide a set of Centrifugo credentials from the config.json file. These credentials are configured on the Centrifugo server, but Laravel will generate example keys that you should replace. You can specify these credentials with the following environment variables:
Required parameters:
Optional parameters, modify if needed:
Make sure to check the BROADCAST_DRIVER
parameter in the .env file:
Client SDKs
For working with clients, see the Client SDK API
Here is a list of SDKs supported by Centrifugal Labs:
- JavaScript — for browser, NodeJS, and React Native
- Golang — for Go language
- Dart — for Dart and Flutter (mobile and web applications)
- Swift — for native iOS development
- Java — for native Android and general Java development
- Python — real-time SDK for Python on top of asyncio
Basic Usage
Set up your Centrifugo server as detailed in the official documentation For sending events, refer to the official Laravel documentation
Here is a simple example of client usage:
Methods for generating client tokens
Method | Description |
---|---|
Generate a token for connection | |
Generate a private token for a private channel |
API Methods
Название | Описание |
---|---|
Send a message to a channel | |
Send a message to multiple channels. | |
Get presence information for a channel (all clients currently subscribed to this channel). | |
Get summary information for a channel (number of clients). | |
Get channel history (list of recent messages sent to the channel). | |
Remove channel history. | |
Subscribe a user to a channel | |
Unsubscribe a user from a channel. | |
Disconnect a user by their ID. | |
List current active channels. | |
Statistical information about running server nodes. |
License
MIT License. Please read the License File for more information.
Support the Project
USDT wallet:
Network:
Contributing 🤝
All versions of laravel-centrifugo with dependencies
ext-json Version *
laravel/framework Version ^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ~6.0|^7.0