Laravel Call to undefined method Redis::connection()

The Redis class is built-in to Laravel and connection() is there. It can't be missing.  You might have installed php-redis on your system. Redis can be another class into php-redis. So there may conflict between Laravel Redis alias and another Redis class.

Now there are two solutions for solving this problem.

  1. You just need to edit your app config, open app/config/app.php and replace this line:

And then you can get your Redis instance like this:

2. Remove php-redis

To remove the php-redis you need to run the below command:

Now restart your Redis server by following command:

  ...  Read More

Share This: