我想要php artisan cache:clear并且不希望删除/清空laravel地平线仪表板
我的地平线包是"laravel/horizon"; "^5.15">
我的env变量是bellow
CACHE_DRIVER =复述,
QUEUE_CONNECTION =复述,
SESSION_DRIVER =复述,
REDIS_CLIENT = predis
REDIS_KEY = oqmm
REDIS_DATABASE = 10
REDIS_HOST = 127.0.0.1
REDIS_PASSWORD =零
REDIS_PORT = 6379
我的本地配置也像下面
`'local' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'auto',
'processes' => 3,
'tries' => 3,
],
],`
我更改了数据库驱动程序的env变量,但它不起作用,并且没有显示地平线仪表板中的任何数据
QUEUE_CONNECTION =数据库
这是查看作业队列GUI的任何解决方案或任何其他方法吗?
您可以为Horizon仪表板数据使用单独的缓存驱动程序。可以通过在config/horizon.php文件中添加以下配置来实现:
<?php
return [
// ...
'environments' => [
'local' => [
'supervisor-1' => [
'connection' => 'redis',
'queue' => ['default'],
'balance' => 'auto',
'processes' => 3,
'tries' => 3,
],
],
],
'redis' => [
'client' => 'predis',
'options' => [
'cluster' => 'redis',
'prefix' => env('REDIS_PREFIX', 'horizon:'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB_HORIZON', '10'),
],
],
// ...
];
然后在config/database.php中为你的数据库驱动程序添加一个新的连接配置。
<?php
return [
// ...
'connections' => [
// ...
'horizon' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'horizon'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
// ...
],
// ...
];
然后清空缓存
php artisan cache:clear && php artisan horizon:terminate