Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm getting error "Class 'Predis\Client' not found" in Laravel 5.2

I want to using Redis in laravel 5.2 however, I'm getting error such a Class 'Predis\Client' not found, How I can solve it.

like image 286
onerciller Avatar asked Jan 18 '16 22:01

onerciller


4 Answers

  1. First download the REDIS to your system (if you haven't already installed it).
  2. Go to the folder where you have downloaded the redis and run this command:

    cd your-redis-folder-name
    make
    
  3. Go to your project directory and install composer:

    composer require predis/predis

  4. Go to your .env file and add Queue driver:

    QUEUE_DRIVER=redis
    
  5. use Mail::queue() to send mail via queue. See Doc.
  6. And in your terminal run:

    php artisan queue:listen 
    

    to send.

like image 123
Abhishek Avatar answered Oct 19 '22 15:10

Abhishek


Write in console in project folder:

composer require predis/predis

And thats all.

like image 34
Kamil Kiełczewski Avatar answered Oct 19 '22 14:10

Kamil Kiełczewski


You need to add predis/predis into composer.json for your project. Reference: https://laravel.com/docs/5.2/redis#introduction

like image 7
Marcin Nabiałek Avatar answered Oct 19 '22 15:10

Marcin Nabiałek


we have add composer.json file "predis/predis": "~1.0" help working fine.

like image 4
Vinod Kumar Pal Avatar answered Oct 19 '22 16:10

Vinod Kumar Pal