johnstontrav's avatar

how to get redis working?

Having trouble getting redis working...

.... "require": { "laravel/lumen-framework": "5.0.*", "vlucas/phpdotenv": "~1.0", "predis/predis": "~1.1@dev" }, ....

Fatal error: Class 'Illuminate\Redis\RedisServiceProvider' not found in /vendor/laravel/lumen-framework/src/Application.php on line 219

Anyone got redis working on lumen?

0 likes
7 replies
yadakhov's avatar

I'm starting to use Lumen and I'm thinking I should have gone with Laravel because of of the time I'm asking 'how do I do this in Lumen when it comes out of the box in Laravel.

2 likes
SP1966's avatar

@yadakhov To use Lumen or not should not be decided based upon if you need what Lumen is missing so much as how much of Laravel don't you need. You may find you have to add a few things to Lumen to get the functionality you desire, but that can still be better than getting those few things included in Laravel with a bunch of other stuff you'll never use.

2 likes
guiguille's avatar

Add this line to your require lines in composer.json (with lumen 5.1) "require": { "illuminate/redis":"5.1.*" }

run composer update. That's it!

bgarrison25's avatar

Why should we have to add that to our composer. In the config it says just to add predis/predis....should we add both? Very confused

nueko's avatar

Hi, There is an Illuminate\Redis\RedisServiceProvider on illuminate/redis package. Just try to register it on the bootstrap file and call it by

// register it
$app->configure('database');
$app->register(RedisServiceProvider::class);

// use it
app('redis')
// or
$app['redis']
//or 
$this->app['redis']
  • Update. typo, sorry.

Please or to participate in this conversation.