Support the ongoing development of Laravel.io →
Configuration Cache Database
Last updated 2 years ago.
0

don't know your code but due to namespaces you may have to write:

\Predis\Client::...

and did you register Predis in your config/app ?

Last updated 9 years ago.
0

This error appears somewhere before my code.

at HandleExceptions->fatalExceptionFromError(array('type' => '1', 'message' => 'Class 'Predis\Client' not found', 'file' => '/vendor/laravel/framework/src/Illuminate/Redis/Database.php', 'line' => '58'

This string in config/app should work with Redis:

'Illuminate\Redis\RedisServiceProvider',

As far as I know there is no need to register it somehow else.. Documentatios says that I need to install it with composer and thats it.

0

Add "predis/predis": "~1.1@dev", to the "require" block in composer.json.

i.e:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*",
        "predis/predis": "~1.1@dev"
    },

    ...

}
Last updated 9 years ago.
0

I get this error Class 'App\Http\Controllers\Predis\Client' not found on my Controller.
In the Controller I simply call

    $client = new Predis\Client();
    $client->set('foo', 'bar');
    $value = $client->get('foo');

and Predis is not recognized. Do I need to add something more after I did a composer require Predis?

Btw I did 'predis/predis' : '1.0' as well as 'predis/predis' : '1.1@dev' AND I do have the Predis director in my vendor directory......

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

AnFox anfox Joined 9 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.