PHPackages                             iliakologrivov/centrifuge - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. iliakologrivov/centrifuge

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iliakologrivov/centrifuge
=========================

centrifuge broadcaster for laravel

1.1(5y ago)46MITPHPPHP ^7.1.3

Since Sep 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/iliakologrivov/centrifuge)[ Packagist](https://packagist.org/packages/iliakologrivov/centrifuge)[ RSS](/packages/iliakologrivov-centrifuge/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (3)Used By (0)

Centrifuge Broadcaster for Laravel 5.4+
=======================================

[](#centrifuge-broadcaster-for-laravel-54)

Introduction
------------

[](#introduction)

Centrifuge broadcaster for laravel &gt;= 5.4

Requirements
------------

[](#requirements)

- PHP 7.1.3+ or newer
- Laravel 5.4 or newer
- Centrifugo Server 2.0 or newer (see [here](https://github.com/centrifugal/centrifugo))

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

[](#installation)

Require this package with composer:

```
composer require iliakologrivov/centrifuge
./artisan vendor:publish --provider='IliaKologrivov\Centrifuge\CentrifugeServiceProvider'
```

Open your web routes and add:

```
IliaKologrivov\Centrifuge\CentrifugeRouterFacade::subscribe();
IliaKologrivov\Centrifuge\CentrifugeRouterFacade::refresh();
```

Open your config/broadcasting.php and add the following to it:

```
'connections' => [
    'centrifuge' => [
        'driver' => 'centrifuge',
    ],
    // ...
],
```

You can also add a configuration to your .env file:

```
CENTRIFUGE_SECRET=
CENTRIFUGE_API_KEY=
CENTRIFUGE_CONNECTION_URL='ws://localhost:8000/connection/websocket
CENTRIFUGE_URL=http://localhost:8000
CENTRIFUGE_VERIFY=false
CENTRIFUGE_SSL_KEY=/etc/ssl/some.pem
CENTRIFUGE_BROADCAST_ERROR=true

```

Do not forget to install the broadcast driver

```
BROADCAST_DRIVER=centrifuge

```

Basic Usage
-----------

[](#basic-usage)

To configure the Centrifugo server, read the [official documentation](https://fzambia.gitbooks.io/centrifugal/content)

For broadcasting events, see the [official documentation of laravel](https://laravel.com/docs/5.3/broadcasting)

A simple example:

```
