PHPackages                             itryit/laravel-ps-redis - 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. itryit/laravel-ps-redis

ActiveLibrary[Caching](/categories/caching)

itryit/laravel-ps-redis
=======================

A simple sentinel/redis driver wrapper for laravel 5.\*. Rewrited For jamescauwelier/psredis

v2.2(10y ago)114.7kMITPHPPHP &gt;=5.4.0

Since Nov 10Pushed 10y ago1 watchersCompare

[ Source](https://github.com/iTryIt/laravel-PSRedis)[ Packagist](https://packagist.org/packages/itryit/laravel-ps-redis)[ RSS](/packages/itryit-laravel-ps-redis/feed)WikiDiscussions master Synced 1mo ago

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

Laravel-PSRedis
===============

[](#laravel-psredis)

A simple sentinel/redis driver wrapper for laravel.

The default laravel redis driver supports redis clusters, however, it does not support high availability with redis, which is where Laravel-PSRedis comes to the rescue.

With Laravel-PSRedis you'll get all the laravel redis magic that you aleady have such as `Redis::set()` and `Redis::get()`, and even session, queue, and cache support using redis, you'll just be able to leverage High Avaliability redis instances instead of a simple cluster.

We do this by asking your [Redis Sentinels](http://redis.io/topics/sentinel) the location of your master before creating our Redis bindings in the IOC Container. By doing this we ensure anytime your app has a connection to your redis instance, that connection is to master.

README Contents
---------------

[](#readme-contents)

- [Installation](#installation)
    - [Laravel 5 Installation](#installation-for-Laravel-5)
- [Configuration](#configuration)
    - [Service Provider](#the-service-provider)
- [Contributing](#contributing);
- [Testing](#testing)
- [License](#license)

\## Installation \### Installation for Laravel 5 You can install Laravel-PSRedis easily with composer.

```
	"require": {
        "itryit/laravel-ps-redis": "v2.2",
    },

```

\## Configuration Next, just fill in your sentinel/redis server info in the `app/config/database.php` config files that already exist in your application.

You may already have some default laravel config values in place in your database config file that looks like this.

```
/*
	|--------------------------------------------------------------------------
	| Redis Databases
	|--------------------------------------------------------------------------
	|
	| Redis is an open source, fast, and advanced key-value store that also
	| provides a richer set of commands than a typical key-value systems
	| such as APC or Memcached. Laravel makes it easy to dig right in.
	|
	*/
	'redis' => [
		'cluster' => false,
		'default' => [
			'host'     => '127.0.0.1',
			'port'     => 6379,
			'database' => 0,
		],
	],

```

Just overwrite those with the values below and fill in your server info.

```
	/** redisConfigName config is supported since version 2.2 */
	'redisConfigName' => 'redis', // your redis setting key name, 'redis' for default, this would be compatible with past versions

	'redis' => [

   		/** the name of the redis node set */
    	'nodeSetName' => 'your-sentinel-node-set-name',

    	'cluster' => false,

    	/** database config is supported since version 2.1 */
    	'database' => 0, // redis database choice

	    /** Array of sentinels */
	    'masters' => [
	        [
	            'host' => 'sentinel-instance.domain.com',
	            'port' => '26379',
	        ],
	        [
            	'host' => 'sentinel-instance.domain.com',
        	    'port' => '26379',
    	    ]
	    ],

    	/** how long to wait and try again if we fail to connect to master */
	    'backoff-strategy' => [
			'max-attempts' => 10, // the maximum-number of attempt possible to find master
			'wait-time' => 500,   // miliseconds to wait for the next attempt
			'increment' => 1.5, // multiplier used to increment the back off time on each try
    	]
    ];

```

\### The Service Provider Finally, you just need to add the service provider to the providers array in `app.php` and comment or remove the redis service provider.

```
	/*
    |--------------------------------------------------------------------------
    | Autoloaded Service Providers
    |--------------------------------------------------------------------------
    |
    */
	'providers' => [
		...
		// 'Illuminate\Redis\RedisServiceProvider', # comment this out
		'Itryit\LaravelPSRedisHelper\LaravelPSRedisServiceProvider' # add this
	],

```

> Note: you may have to `composer dump-autoload` after adding the service provider

\## Contributing 1. Fork it
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -m 'Added some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request

\## Testing Feel free to clone the repo and run the unit tests locally.

```
	./vendor/bin/phpunit -c ./phpunit.xml

```

\## License \[The MIT License (MIT)\](https://github.com/iTryIt/laravel-PSRedis/blob/master/LICENSE)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 65.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 ~22 days

Total

3

Last Release

3791d ago

### Community

Maintainers

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

---

Top Contributors

[![iTryIt](https://avatars.githubusercontent.com/u/15669389?v=4)](https://github.com/iTryIt "iTryIt (15 commits)")[![Olofguard](https://avatars.githubusercontent.com/u/1020137?v=4)](https://github.com/Olofguard "Olofguard (6 commits)")[![bkuhl](https://avatars.githubusercontent.com/u/524933?v=4)](https://github.com/bkuhl "bkuhl (1 commits)")[![jlaswell](https://avatars.githubusercontent.com/u/1676217?v=4)](https://github.com/jlaswell "jlaswell (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/itryit-laravel-ps-redis/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[genealabs/laravel-model-caching

Automatic caching for Eloquent models.

2.4k4.8M26](/packages/genealabs-laravel-model-caching)[mikebronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k127.1k1](/packages/mikebronner-laravel-model-caching)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[laragear/cache-query

Remember your query results using only one method. Yes, only one.

272122.8k](/packages/laragear-cache-query)[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)

PHPackages © 2026

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