Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
/ laravel-phpredis Public archive

A Redis driver for Laravel and Lumen that works with PhpRedis, the PECL Redis Extension.

License

Notifications You must be signed in to change notification settings

tillkruss/laravel-phpredis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhpRedis driver for Laravel & Lumen

Build Status Latest Stable Version License

This package provides a drop-in replacement for Laravel’s and Lumen’s RedisServiceProvider, that adds compatibility for PhpRedis, the PECL Redis Extension.

Using PhpRedis instead of Predis with Laravel’s default RedisServiceProvider will result in false-positives across the framework, because PhpRedis returns false instead of null if a key does not exist.

Requirements

  • PHP 5.5.9+
  • Laravel 5.1+
  • Lumen 5.1+
  • PhpRedis 2.2.8+

Laravel Installation

First, install this package via Composer:

composer require tillkruss/laravel-phpredis

Then open your app configuration file and remove (or comment-out) the default Redis service provider from your providers list:

// Illuminate\Redis\RedisServiceProvider::class,

Next, register the new service provider by adding it to the end of your providers list:

TillKruss\LaravelPhpRedis\RedisServiceProvider::class,

Finally, make sure you already renamed or removed the alias for Redis in your aliases list.

Lumen Installation

First, install this package via Composer:

composer require tillkruss/laravel-phpredis

If you haven’t already, install illuminate/redis as well:

composer require illuminate/redis

Next, register the Redis service provider in your bootstrap/app.php file.

$app->register(TillKruss\LaravelPhpRedis\RedisServiceProvider::class);

Finally, if you have not called $app->withEloquent() in your bootstrap/app.php file, then you need to call $app->configure('database'); to ensure the Redis database configuration is properly loaded.

License

This package is open-sourced software licensed under the MIT license.

About

A Redis driver for Laravel and Lumen that works with PhpRedis, the PECL Redis Extension.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages