Categories
Laravel

How to Get All Redis Cache Keys in Laravel

TL;DR:

Cache::getRedis()->keys("*")

If you’ve set up your Laravel application with Redis and you want to see all the keys registered in your Redis, simply open Laravel Tinker using the following command:

php artisan tinker

And then run the following code snippet to get all the keys available in your redis:

Cache::getRedis()->keys("*")