Laravel Cache facade not storing data in Redis #58833
Unanswered
Tawheedyahya
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone 👋 I’m facing an issue with Laravel cache and Redis. Here are the details: OS: Ubuntu PHP: PHP 8.3 Laravel: 12 Redis: installed via apt and also tested with Docker
Redis PHP extension: php-redis installed
What I did:
Set Redis as cache store in .env: CACHE_STORE=redis REDIS_HOST=127.0.0.1 REDIS_PORT=6379
Cleared config cache: php artisan optimize:clear
Verified in Tinker: config('cache.default'); // returns "redis"
The problem:
Using the Redis facade works: Redis::set('test', 'ok');
But the Cache facade does not store anything: Cache::put('name', 'yahi', 300); Cache::get('name'); // returns value, but key not visible in redis
I use jwt/tymon To generate token but go to dashboard token not provided
I tried for 1 and half day anyone help to rectify this issue
Beta Was this translation helpful? Give feedback.
All reactions