1composer require predis/predis
2
3.env - file
4
5 BROADCAST_DRIVER=log
6 CACHE_DRIVER=redis
7 FILESYSTEM_DRIVER=local
8 QUEUE_CONNECTION=sync
9 SESSION_DRIVER=file
10 SESSION_LIFETIME=120
11
12 MEMCACHED_HOST=127.0.0.1
13
14 REDIS_HOST=127.0.0.1
15 REDIS_PASSWORD=null
16 REDIS_PORT=6379
17 REDIS_CLIENT=predis
1'redis' => [
2
3 'client' => 'predis',
4
5 // Keep Default as is you want to use both redis and sentinel for different service(cache, queue)'
6 'default' => [
7 'host' => env('REDIS_HOST', '127.0.0.1'),
8 'password' => env('REDIS_PASSWORD', null),
9 'port' => env('REDIS_PORT', 6379),
10 'database' => 0,
11 ],
12
13 // Create a custom connection to use redis sentinel
14 'cache_sentinel' => [
15 // Set the Sentinel Host from Environment (optinal you can hardcode if want to use in prod only)
16 env('CACHE_REDIS_SENTINEL_1'),
17 env('CACHE_REDIS_SENTINEL_2'),
18 env('CACHE_REDIS_SENTINEL_3'),
19 'options' => [
20 'replication' => 'sentinel',
21 'service' => 'cachemaster'),
22 'parameters' => [
23 'password' => env('REDIS_PASSWORD', null),
24 'database' => 0,
25 ],
26 ],
27 ],
28 ],
29