PHPackages                             ostah/laravel-redis-stream - 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. [Caching](/categories/caching)
4. /
5. ostah/laravel-redis-stream

ActiveLibrary[Caching](/categories/caching)

ostah/laravel-redis-stream
==========================

Laravel redis stream

1.1.4(3mo ago)099↓33.3%MITPHPPHP ^7.4|^8.0

Since Feb 3Pushed 3mo agoCompare

[ Source](https://github.com/mohmmedwee/laravel-redis-stream)[ Packagist](https://packagist.org/packages/ostah/laravel-redis-stream)[ RSS](/packages/ostah-laravel-redis-stream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Redis Stream
====================

[](#laravel-redis-stream)

Manage Redis stream messages by firing handler classes per channel. You can assign multiple handler classes to the same channel.

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

[](#requirements)

- PHP ^7.4 | ^8.0
- Laravel / Lumen ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0
- Redis (phpredis driver recommended)

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

[](#installation)

Install the package via Composer:

```
composer require ostah/laravel-redis-stream
```

### Laravel

[](#laravel)

Publish the config file:

```
php artisan vendor:publish --tag=laravel-redis-stream-config
```

### Lumen

[](#lumen)

1. Register the service provider in `bootstrap/app.php`:

```
$app->register(LaravelStream\Redis\StreamServiceProvider::class);
```

2. Ensure Redis is registered (add if not already present):

```
$app->register(Illuminate\Redis\RedisServiceProvider::class);
```

3. Copy the config file from `vendor/ostah/laravel-redis-stream/config/streaming.php` to `config/streaming.php`.

> For more on Redis with Lumen, see the [Lumen cache documentation](https://lumen.laravel.com/docs/cache).

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

[](#configuration)

In `config/streaming.php`:

1. **Redis connection** – Set the connection name under the `redis.connection` key. This must match a connection defined in `config/database.php` (e.g. `default` or a custom `stream` connection).
2. **Channels and handlers** – Define channels and their handler classes:

```
'channels' => [
    'channel-name' => [
        App\Channels\SomeClassChannel::class,
    ],
],
```

3. **Trim (optional)** – Limit stream length per channel:

```
'trim' => [
    'channel-name' => 1000, // keep at most 1000 messages
],
```

We recommend using the **phpredis** driver for Redis.

Creating a handler class
------------------------

[](#creating-a-handler-class)

Generate a channel listener with Artisan (created in `app/Channels`):

```
php artisan make:channel-listener SomeClassChannel
```

Running the channel listener
----------------------------

[](#running-the-channel-listener)

Listen to all channels:

```
php artisan stream:run
```

Listen to a specific channel:

```
php artisan stream:run --channel=channel-name
```

Sending messages to a Redis stream
----------------------------------

[](#sending-messages-to-a-redis-stream)

Use the `Stream` facade to publish messages (xADD):

```
use LaravelStream\Redis\Facades\Stream;

$messageId = Stream::stream($channel, $data, $trim);
```

ParameterTypeDescription`$channel`stringChannel name`$data`mixedMessage payload (will be JSON- or msgpack-encoded per config)`$trim`int|nullMax stream length for this channel. `null` = use config; `0` = no trimmingLicense
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance80

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

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

104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7376e8fde8731f11615be3ca0867fe84c40caa998c2854d4a799bc8223dac102?d=identicon)[mohmmedwee](/maintainers/mohmmedwee)

---

Top Contributors

[![asd4abyd](https://avatars.githubusercontent.com/u/15715732?v=4)](https://github.com/asd4abyd "asd4abyd (16 commits)")[![anasalmasri99](https://avatars.githubusercontent.com/u/211709520?v=4)](https://github.com/anasalmasri99 "anasalmasri99 (1 commits)")

---

Tags

streamlaravelartisanrediscommandchannelMicroservicexreadxadd

### Embed Badge

![Health badge](/badges/ostah-laravel-redis-stream/health.svg)

```
[![Health](https://phpackages.com/badges/ostah-laravel-redis-stream/health.svg)](https://phpackages.com/packages/ostah-laravel-redis-stream)
```

###  Alternatives

[monospice/laravel-redis-sentinel-drivers

Redis Sentinel integration for Laravel and Lumen.

103830.5k](/packages/monospice-laravel-redis-sentinel-drivers)[namoshek/laravel-redis-sentinel

An extension of Laravels Redis driver which supports connecting to a Redis master through Redis Sentinel.

38679.0k](/packages/namoshek-laravel-redis-sentinel)[yangusik/laravel-balanced-queue

Laravel queue management with load balancing between partitions (user groups)

786.4k](/packages/yangusik-laravel-balanced-queue)[vetruvet/laravel-phpredis

Use phpredis as the redis connection in Laravel

43123.7k](/packages/vetruvet-laravel-phpredis)[ginnerpeace/laravel-redis-lock

Simple redis distributed locks for Laravel.

15114.4k](/packages/ginnerpeace-laravel-redis-lock)[huangdijia/laravel-redis-ide-helper

Redis ide-helper for Laravel.

1243.3k](/packages/huangdijia-laravel-redis-ide-helper)

PHPackages © 2026

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