修改配置文件
config/cache.php
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
这里的connection对应config/database中redis的默认主机default配置。
config/database.php
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],