John Davidson

php - Laravel put :notify to the end of redis keys

0 comments
Message:


recently I migrate from laravel 5.7 to 8 and some queues that dispatch from laravel has add to end of its key name ":notify"... somebody know why and how avoid this?.. i'm using predis as client.



My Answer:
To add ":notify" to the end of Redis keys in Laravel, you can modify the configuration in your `config/database.php` file.

In the Redis section of the configuration file, you can add a suffix to the `options` array like this:

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,
'options' => [
'prefix' => env('REDIS_PREFIX', ''),
'suffix' => ':notify',
],
],
],


By adding `'suffix' => ':notify'` to the options array, all Redis keys will have ":notify" appended to the end of their key names.

Remember to clear your cache after making changes to the configuration file by running `php artisan config:clear`.

Rate this post

5 of 5 based on 6797 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us