PHP code example of dpsarr / laravel-redis-sentinel

1. Go to this page and download the library: Download dpsarr/laravel-redis-sentinel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dpsarr / laravel-redis-sentinel example snippets


    'redis' => [
        'client' => env('REDIS_CLIENT', 'phpredis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
        ],

        'default' => [
            'password' => env('REDIS_PASSWORD', null),
            'database' => env('REDIS_DB', '0'),
            'master' => 'mymaster',
            'sentinel' => [
                'hosts' => [
                    '172.21.0.1' => 26379,
                ],
                'timeout' => 0,
                'persistent' => null,
                'retry_interval' => 0,
                'read_timeout' => 0,
            ],
        ],
    ],