Maybe it's not using redis, have you overridden CACHE_DRIVER in your .env?
Or did you switch around cache drivers and maybe have you local config cached (php artisan config:clear) and thus it picks the wrong cache driver?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey guys,
I've had a quick search on the forum but can't find an answer, hoping someone can help.
On my local dev machine, I frequently run:
php artisan migrate:fresh --seed
Since I'm caching things with redis via "Cache::" I need to flush the cache each time.
It would be ideal if I could figure how to do this automatically on each migration, perhaps I could add Cache::flush(); somewhere?
Problem:
When I run php artisan cache:clear, the cached data is not actually flushed. I confirm this using the redis-cli client and of course the cached data is still being shown in my app.
Setup:
In config/cache.php I have the following:
'default' => env('CACHE_DRIVER', 'redis'),
Data is being stored with Cache::set('somekey', $data) and retrieved withCache::get('somekey')
Is there anything else I should be aware of?
Thanks!
Maybe it's not using redis, have you overridden CACHE_DRIVER in your .env?
Or did you switch around cache drivers and maybe have you local config cached (php artisan config:clear) and thus it picks the wrong cache driver?
Please or to participate in this conversation.