PHPackages                             olexin-pro/cenrtifuge - 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. olexin-pro/cenrtifuge

ActiveLibrary

olexin-pro/cenrtifuge
=====================

centrifuge for roadrunner laravel-bridge

v0.0.1(1mo ago)01↑2900%MITPHPPHP ^8.3

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/olexin-pro/cenrtifuge)[ Packagist](https://packagist.org/packages/olexin-pro/cenrtifuge)[ RSS](/packages/olexin-pro-cenrtifuge/feed)WikiDiscussions main Synced 1mo ago

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

Centrifuge for RoadRunner Laravel Bridge
========================================

[](#centrifuge-for-roadrunner-laravel-bridge)

> **EXPERIMENTAL**This package is an experiment and a work in progress. Use it at your own risk. The API may change without notice and there are no stability guarantees.

Laravel package for integrating [Centrifugo](https://centrifugal.dev/) WebSocket server with [RoadRunner](https://roadrunner.dev/) via the `roadrunner-php/laravel-bridge`.

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

[](#requirements)

- PHP 8.3+
- Laravel 10, 11, or 12
- RoadRunner with `roadrunner-php/laravel-bridge` ^6.0
- `roadrunner-php/centrifugo` ^2.2

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

[](#installation)

```
composer require olexin-pro/cenrtifuge
```

Publish the config and route stubs:

```
php artisan vendor:publish --tag=centrifuge-config
php artisan vendor:publish --tag=centrifuge-routes
```

Configuration
-------------

[](#configuration)

Config file: `config/centrifuge.php`

KeyDefaultDescription`use_broadcasting_channels``false`Use `routes/channels.php` (Laravel Broadcasting) instead of `routes/centrifuge.php``guards``['sanctum', 'session']`Auth guards tried in order during connection`rpc.routes_path``routes/rpc.php`Path to RPC routes file`channels.routes_path``routes/centrifuge.php`Path to channel routes file`handlers`see belowMap of Centrifugo request types to handler classes### Environment variables

[](#environment-variables)

```
CENTRIFUGE_USE_BROADCASTING=false
```

RoadRunner Worker
-----------------

[](#roadrunner-worker)

Register `CentrifugoWorker` in your RoadRunner configuration:

```
# .rr.yaml
centrifuge:
  proxy_connect_timeout: 1s
  # ...
```

Point RoadRunner to `CentrifugoWorker::class` as the worker implementation in your bootstrap.

Channel Authorization
---------------------

[](#channel-authorization)

By default, channels are authorized via `routes/centrifuge.php`:

```
use Illuminate\Contracts\Auth\Authenticatable;
use OlexinPro\Centrifuge\Routing\ChannelRouter;

/** @var ChannelRouter $centrifuge */

// Private channel with a parameter
$centrifuge->channel('private-user.{userId}', function (?Authenticatable $user, string $userId) {
    return $user && (int) $user->getAuthIdentifier() === (int) $userId;
});

// Public channel
$centrifuge->channel('public.chat', function () {
    return true;
});
```

To use Laravel's standard `routes/channels.php` instead, set `CENTRIFUGE_USE_BROADCASTING=true`.

RPC
---

[](#rpc)

Register RPC handlers in `routes/rpc.php`:

```
use OlexinPro\Centrifuge\Routing\RpcRouter;

/** @var RpcRouter $rpc */

// Global middleware
$rpc->middleware([\App\Centrifuge\Middleware\LogRpcRequest::class]);

// Single method
$rpc->register('ping', \App\Centrifuge\Handlers\PingHandler::class);

// Grouped methods with middleware
$rpc->group('', [\App\Centrifuge\Middleware\RequireAuth::class], function (RpcRouter $rpc) {
    $rpc->group('posts', [], function (RpcRouter $rpc) {
        $rpc->register('create', \App\Centrifuge\Handlers\CreatePostHandler::class);
    });
});
```

Registered method name for nested groups is built as `prefix.method`, e.g. `posts.create`.

### Implementing an RPC handler

[](#implementing-an-rpc-handler)

```
use Illuminate\Contracts\Auth\Authenticatable;
use OlexinPro\Centrifuge\Contracts\RpcHandlerContract;
use RoadRunner\Centrifugo\Request\RPC;

class PingHandler implements RpcHandlerContract
{
    public function handle(array $data, ?Authenticatable $user, RPC $request): mixed
    {
        return ['pong' => true];
    }
}
```

Custom Handlers
---------------

[](#custom-handlers)

Override any built-in request handler by rebinding it in `config/centrifuge.php`:

```
'handlers' => [
    \RoadRunner\Centrifugo\Request\Connect::class   => \App\Centrifuge\Handlers\MyConnectHandler::class,
    \RoadRunner\Centrifugo\Request\Subscribe::class => \OlexinPro\Centrifuge\Handlers\SubscribeHandler::class,
    // ...
],
```

All handler classes must implement `OlexinPro\Centrifuge\Contracts\RequestHandler`.

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/140a9b26ee37fdccbed9cf124340643fbeb2d4e11ab1a5382dda8c8f34a69afe?d=identicon)[ol3x1n](/maintainers/ol3x1n)

---

Top Contributors

[![olexin-pro](https://avatars.githubusercontent.com/u/9531609?v=4)](https://github.com/olexin-pro "olexin-pro (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/olexin-pro-cenrtifuge/health.svg)

```
[![Health](https://phpackages.com/badges/olexin-pro-cenrtifuge/health.svg)](https://phpackages.com/packages/olexin-pro-cenrtifuge)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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