PHPackages                             cooperaj/laravel-redis-sentinel - 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. [Queues &amp; Workers](/categories/queues)
4. /
5. cooperaj/laravel-redis-sentinel

ActiveLibrary[Queues &amp; Workers](/categories/queues)

cooperaj/laravel-redis-sentinel
===============================

Provides a laravel queue driver that works with Redis Sentinels.

v1.0(9y ago)1731.4k7[2 issues](https://github.com/cooperaj/laravel-redis-sentinel/issues)MITPHPPHP &gt;5.5.0

Since Jul 21Pushed 9y ago3 watchersCompare

[ Source](https://github.com/cooperaj/laravel-redis-sentinel)[ Packagist](https://packagist.org/packages/cooperaj/laravel-redis-sentinel)[ RSS](/packages/cooperaj-laravel-redis-sentinel/feed)WikiDiscussions master Synced 4w ago

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

Laravel Redis Sentinel
======================

[](#laravel-redis-sentinel)

[![Build Status](https://camo.githubusercontent.com/18f1194c59caae25aa8398b033380b6b496899fabd7e88eded8bcb578d280cbc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6f706572616a2f6c61726176656c2d72656469732d73656e74696e656c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/cooperaj/laravel-redis-sentinel/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/39ce51fb144dfa11be5647ccda33902c74a9b11f800db769b571d0efaf068390/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6f706572616a2f6c61726176656c2d72656469732d73656e74696e656c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/cooperaj/laravel-redis-sentinel/?branch=master)

This provides a Sentinel aware driver for Laravel. A Redis cluster with Sentinels supports a high availability Master/Slave architecture that provides automatic failover should a node stop working.

It's simple code and merely allows you to configure Sentinels correctly by changing some assumptions Laravel makes about how you're using Redis.

### Compatibility

[](#compatibility)

VersionSupported Laravel Version^0.0^5.2^1.0^5.3### Installation

[](#installation)

Add the Service provider to your `config/app.php`, you should also comment out (or remove) the default `illuminate` Redis driver:

```
'providers' => [

    // Illuminate\Redis\RedisServiceProvider::class,

    ...

    RedisSentinel\Laravel\RedisSentinelServiceProvider::class,
]

```

Point your Redis database at a set of Redis Sentinels. Change the `redis` part of your `config/database.php` to something like:

```
'redis' => [

    'cluster' => false,

    'default' => [
        [
            'host' => env('REDIS_SENTINEL_1'),
            'port' => 26379
        ],
        [
            'host' => env('REDIS_SENTINEL_2'),
            'port' => 26379
        ],
        [
            'host' => env('REDIS_SENTINEL_3'),
            'port' => 26379
        ],
        'options' => [
            'replication' => 'sentinel',
            'service' => 'mymaster',
            'parameters' => [
                'database' => 0,
                'password' => env('REDIS_PASSWORD', null)
            ]
        ]
    ],

    // optional configuration for a separate Redis 'database' for just a cache
    'cache' => [
        [
            'host' => env('REDIS_SENTINEL_1'),
            'port' => 26379
        ],
        [
            'host' => env('REDIS_SENTINEL_2'),
            'port' => 26379
        ],
        [
            'host' => env('REDIS_SENTINEL_3'),
            'port' => 26379
        ],
        'options' => [
            'replication' => 'sentinel',
            'service' => 'mymaster',
            'parameters' => [
                'database' => 1, // note the differing 'database' number
                'password' => env('REDIS_PASSWORD', null)
            ]
        ]
    ],

    'options' => [
    ]

],

```

Optionally you can add a configuration option that causes Predis to interrogate a given Sentinel for a complete list of Sentinels. If you do this then you only need to provide a single Sentinel in the configuration. Predis will ensure that the Sentinel list is kept up to date on subsequent queries.

```
'default' => [
    [
        'host' => env('REDIS_SENTINEL'),
        'port' => 26379
    ],
    'options' => [
        'replication' => 'sentinel',
        'service' => 'mymaster',
        'update_sentinels' => true,
        'parameters' => [
            'database' => 0,
            'password' => env('REDIS_PASSWORD', null)
        ]
    ]
],

```

### Queue

[](#queue)

Add a connection to your `config/queue.php` file:

```
'connections' => [

    ...

    'sentinel' => [
        'driver' => 'sentinel-redis',
        'connection' => 'default', // or any other named 'database' you define in database.php
        'queue' => 'default',
        'retry_after' => 90,
    ],
],

```

Configure your env file to use the new driver:

```
QUEUE_DRIVER=sentinel

```

### Cache

[](#cache)

Laravel will quite happily use Redis as a cache location. What they don't tell you is that clearing your cache does a simplistic `FLUSHDB` command. Something you don't want to use if you're also using queues in Redis. *"Oh no, all my queued jobs have disappeared"*.

To fix this setup a cache database configuration as shown in the example `config/database.php` snippet above, ensuring that you use a different database number and change the Redis section of `config/cache.php` to read:

```
'redis' => [
    'driver' => 'redis',
    'connection' => 'cache', \\ make sure this matches the name you gave your 'database'
],

```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

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

Every ~107 days

Total

4

Last Release

3310d ago

Major Versions

v0.3 → v1.02017-06-08

PHP version history (2 changes)v0.1PHP ^5.5.0

v0.2PHP &gt;5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b29a01a1eb6266be7125d591ba6fe155bbdf80ac5d1d0d4151d09f040a792989?d=identicon)[cooperaj](/maintainers/cooperaj)

---

Top Contributors

[![cooperaj](https://avatars.githubusercontent.com/u/400210?v=4)](https://github.com/cooperaj "cooperaj (20 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cooperaj-laravel-redis-sentinel/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M284](/packages/laravel-horizon)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[illuminate/queue

The Illuminate Queue package.

21332.6M1.5k](/packages/illuminate-queue)[illuminate/notifications

The Illuminate Notifications package.

513.1M1.1k](/packages/illuminate-notifications)

PHPackages © 2026

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