Laravel - Redis - Predis
If you would like your application to interact with Redis via the Predis package, you should ensure the REDIS_CLIENT
environment variable's value is predis
:
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
// Rest of Redis configuration...
],
In addition to the default host
, port
, database
, and password
server configuration options, Predis supports additional connection parameters that may be defined for each of your Redis servers. To utilize these additional configuration options, add them to your Redis server configuration in your application's config/database.php
configuration file:
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
'read_write_timeout' => 60,
],