PHP code example of vetruvet / laravel-phpredis

1. Go to this page and download the library: Download vetruvet/laravel-phpredis 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/ */

    

vetruvet / laravel-phpredis example snippets


...
'providers' => array(
    ...
    // 'Illuminate\Redis\RedisServiceProvider',
    'Vetruvet\PhpRedis\PhpRedisServiceProvider',
    ...
),
...

...
'aliases' => array(
    ...
    'LRedis'           => 'Illuminate\Support\Facades\Redis', 
    ...
),
...

'redis' => array(

    'cluster' => true, // if true a RedisArray will be created

    'default' => array(
        'host'       => '127.0.0.1', // default: '127.0.0.1'
        'port'       => 6379,        // default: 6379
        'password'   => password     // default: null
        'prefix'     => 'myapp:',    // default: ''
        'database'   => 7,           // default: 0
        'timeout'    => 0.5,         // default: 0 (no timeout)
        'serializer' => 'igbinary'   // default: 'none', possible values: 'none', 'php', 'igbinary'
    ),

),