PHPackages                             vetruvet/laravel-phpredis - 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. vetruvet/laravel-phpredis

ActiveLibrary[Caching](/categories/caching)

vetruvet/laravel-phpredis
=========================

Use phpredis as the redis connection in Laravel

v1.0.4(9y ago)43123.7k↓48.1%9[7 issues](https://github.com/vetruvet/laravel-phpredis/issues)ApachePHP

Since Apr 29Pushed 9y ago3 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (4)Used By (0)

PhpRedis Connector for Laravel
==============================

[](#phpredis-connector-for-laravel)

[Laravel](http://laravel.com/) by default uses [Predis](https://github.com/nrk/predis) to connect to Redis.

On servers which have [PhpRedis](https://github.com/nicolasff/phpredis) installed, you may want to use it instead of Predis for performance. This package provides a drop-in replacement for the `RedisServiceProvider` that comes with Laravel.

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

[](#requirements)

- PHP 5.3+
- [PhpRedis](https://github.com/nicolasff/phpredis)
- Laravel 4.x/5.x

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

[](#installation)

First, of course, make sure PhpRedis is installed on the server. See [here](https://github.com/nicolasff/phpredis#installingconfiguring) for installation instructions.

Add the dependency to `composer.json`:

```
"require": {
    "vetruvet/laravel-phpredis": "1.*"
}

```

Add the `PhpRedisServiceProvider` to `config/app.php` (comment out built-in `RedisServiceProvider`):

```
...
'providers' => array(
    ...
    // 'Illuminate\Redis\RedisServiceProvider',
    'Vetruvet\PhpRedis\PhpRedisServiceProvider',
    ...
),
...

```

The default Facade alias conflicts with the Redis class provided by PhpRedis. To fix this, rename the alias in `config/app.php`:

```
...
'aliases' => array(
    ...
    'LRedis'           => 'Illuminate\Support\Facades\Redis',
    ...
),
...

```

An unfortunate side effect is that you need to call the Redis functions like `LRedis::connection()` now which does not look as nice or slick, but everything still works the same way (you can call Redis commands as usual, e.g. `LRedis::get('key')`.

Finally run `composer update` to update and install everything.

Options
-------

[](#options)

Configuration is just like the default config for Redis in Laravel. In fact, you can switch between PhpRedis and Predis without changing your configuration (no guarantees for clustering or serialization though).

All options are optional, you can specify an empty array to get the default connection configuration:

```
'redis' => array(

    'cluster' => true, // if true a RedisArray will be created

    'default' => array(
        'host'       => '127.0.0.1', // default: '127.0.0.1'
        'port'       => 6379,        // default: 6379
        'password'   => password     // default: null
        'prefix'     => 'myapp:',    // default: ''
        'database'   => 7,           // default: 0
        'timeout'    => 0.5,         // default: 0 (no timeout)
        'serializer' => 'igbinary'   // default: 'none', possible values: 'none', 'php', 'igbinary'
    ),

),

```

The only option that is not self-explanatory is the `serializer` option. The values correspond directly to the `Redis::SERIALIZER_*` constants in PhpRedis. If you specify `igbinary`, igbinary will be used as the serializer if PhpRedis was compiled with `--enable-redis-igbinary`, falling back to PHP's built-in serializer otherwise.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~386 days

Total

3

Last Release

3630d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32dc269c88de63744210eb50e582fac46d4989592ea877e71d3d3ffd5e461d07?d=identicon)[vetruvet](/maintainers/vetruvet)

---

Top Contributors

[![vetruvet](https://avatars.githubusercontent.com/u/149282?v=4)](https://github.com/vetruvet "vetruvet (11 commits)")[![eddturtle](https://avatars.githubusercontent.com/u/902607?v=4)](https://github.com/eddturtle "eddturtle (1 commits)")

---

Tags

laravelredisphpredis

### Embed Badge

![Health badge](/badges/vetruvet-laravel-phpredis/health.svg)

```
[![Health](https://phpackages.com/badges/vetruvet-laravel-phpredis/health.svg)](https://phpackages.com/packages/vetruvet-laravel-phpredis)
```

###  Alternatives

[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)[monospice/laravel-redis-sentinel-drivers

Redis Sentinel integration for Laravel and Lumen.

103830.5k](/packages/monospice-laravel-redis-sentinel-drivers)[yangusik/laravel-balanced-queue

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

786.4k](/packages/yangusik-laravel-balanced-queue)[longman/laravel-lodash

Add more functional to Laravel

9792.9k](/packages/longman-laravel-lodash)[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)
