env('REDIS_CLIENT', 'predis'),
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
],
'cache' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
cache.php
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
and that is how i use it.
$redis = new Client();
$redis->set('wd', 'wfw' ,12);
$redis->setex('dw' , '35' , 3);
in laravel
Обсуждают сегодня