I am trying to use predis in laravel 5.2.I have installed predis and redis via composer.json in require as predis" :"~1.0".Then I did composer update and also ran composer require illuminate/redis to pull redis files.
but when i am using in my controller(showing only related code)
//Code
use Redis;
function index(){
Redis::set("masterpowers", "Yeah Baby Yeah");
print_r(Redis::get("masterpowers"));
}
//Code ends
Its showing error in localhost as well as in terminal-
FatalErrorException in ProviderRepository.php line 146: Class 'lluminate\Redis\RedisServiceProvider' not found
I have installed redis client too and my command redis-cli ping working fine.
Make sure in your config/app.php
file that Illuminate\Redis\RedisServiceProvider::class
is listed under providers, then run terminal command composer dump-autoload
(regardless if class is found or not).
By default in laravel framework, RedisServiceProvider is already configured in config/app as well as its Facade.
Remove the line of predis in your composer.json and run this:
composer require predis/predis
You may have missed the actual package by updating the composer.json alone.