t0berius
1 week ago
338
1
General

laravel Cache not displaying same values as redis

Posted 1 week ago by t0berius

Using the following code to query the cache:

//displays the correct value
dd(Redis::get('someValue'));
//displays null
dd(Cache::store('redis')->get('someValue'));
//displays null
dd(Cache::get('someValue'));

cache.php

'default' => env('CACHE_DRIVER', 'file'),

.env

CACHE_DRIVER=redis

database.php

'redis' => [

    'client' => 'predis',
    'options' => [
    ],

    'default' => [
        'host' => '127.0.0.1',
        'password' => null,
        'port' => 6379,
        'database' => 0,
    ],

Any idea why I cannot query the correct key / value when using the Cachedriver?

Please sign in or create an account to participate in this conversation.