gazd1977
2 months ago
282
4
Laravel

PHPRedis installation or issue with facade

Posted 2 months ago by gazd1977

Im trying to install phpredis and have followed this video - i think correctly.

Im now trying to test whether i have installed phpredis correctly by trying to set and get a variable (as below),

use Illuminate\Redis\RedisManager;


Route::get('redis', function(){
    RedisManager::set('name', Str::random(10));
    dd(RedisManager::get('name'));
});

I'm confused however by the docs where its states you should alias the facade (i have done as suggested) though it later says generally you should delete the alias (and ref the full facade path).

'RedisManager' => Illuminate\Support\Facades\Redis::class,

Following the above I'm getting an error Call to undefined method Illuminate\Redis\RedisManager::set()

Im assuming that i havent install the php redis extension correctly - is the above confirming that or am i making a mistake with the 'alias'?

Thanks

edit

Found this thread which might be of use to others as well.

endedit

Please sign in or create an account to participate in this conversation.