I started with redis. I need to have a fast database and now i decided also to cache things in another redis database. I use redisinsight and saw, that i can switch between the databases by number. I now want to put key/values with cache() into redis database number 2. But how can i set up this? If i user redis method, i can call select like this:
redis()->select(2)
Now I'm looking for setup in cache. I tried this:
'mycache' => [
'driver' => 'redis',
'connection' => 'cache'
'lock_connection' => 1,
],
```
And it works for database 1. Key/Value is set in database one. But when I use 2 here id does not work. Does anybody have an idea?
cache()->store('mycache1')->put('homer', 'simpson', 20);
cache()->store('mycache2')->put('fred', 'feuerstein', 20);
```
I know that it also in the documentation with 'database'=>XX, but it does not work. Maybe i should switch and do it with redis() helper method. But I think it would be better to use with cache because of functions like remember.
Thx @sinnbeck for your help. I found the problem. I placed the database key into config/cache.php, but i had to set it in config/database.php and then use db key i set in database.php as connection value in cache.php. Sorry ... i just started with that topic.