Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Cache Ui Laravel

Cache Ui Laravel stats

Downloads
8
Stars
4
Open Issues
0
Forks
0

View on GitHub →

List, search and delete individual cache keys without having to purge the entire cache

Cache UI Laravel

Cache UI Laravel

A Laravel package that allows you to list, search and delete individual cache keys without having to purge the entire cache. Supports multiple cache drivers (Redis, File, Database) with an interactive command line interface.

Installation

You can install the package via composer:

composer require abr4xas/cache-ui-laravel

Optionally, you can publish the config file with:

php artisan vendor:publish --tag="cache-ui-laravel-config"

Configuration

After publishing the config file, you can customize the package behavior:

return [
// Default cache store to use
'default_store' => env('CACHE_UI_DEFAULT_STORE', null),
 
// Character limit in value preview
'preview_limit' => env('CACHE_UI_PREVIEW_LIMIT', 100),
 
// Number of visible items in scroll
'search_scroll' => env('CACHE_UI_SEARCH_SCROLL', 15),
];

You can also configure these values in your .env file:

CACHE_UI_DEFAULT_STORE=redis
CACHE_UI_PREVIEW_LIMIT=150
CACHE_UI_SEARCH_SCROLL=20

Usage

Basic Command

Run the command to list and manage cache keys:

php artisan cache:list

Specify a Cache Store

If you have multiple cache stores configured, you can specify which one to use:

php artisan cache:list --store=redis

Features

  • 🔍 Interactive search: Search cache keys by typing text
  • 📋 List all keys: View all available keys in your cache
  • 🗑️ Selective deletion: Delete individual keys without affecting the rest of the cache
  • 🔌 Multiple drivers: Supports Redis, File and Database

Supported Drivers

  • Redis: Lists all keys using Redis KEYS command
  • File: Reads cache files from the filesystem
  • Database: Queries the cache table in the database
  • ⚠️ Array: Not supported (array driver doesn't persist between requests)
  • ⚠️ Memcached: Not currently supported

Usage Example

$ php artisan cache:list
 
📦 Cache driver: redis
Found 23 cache keys
 
🔍 Search and select a cache key to delete
> user_1_profile
 
📝 Key: user_1_profile
 
Are you sure you want to delete this cache key? No / Yes
 
🗑️ The key 'user_1_profile' has been successfully deleted

Programmatic Usage (optional)

You can also use the CacheUiLaravel class directly in your code:

use Abr4xas\CacheUiLaravel\Facades\CacheUiLaravel;
 
// Get all cache keys from default store
$keys = CacheUiLaravel::getAllKeys();
 
// Get all cache keys from a specific store
$redisKeys = CacheUiLaravel::getAllKeys('redis');
 
// Delete a specific key from default store
$deleted = CacheUiLaravel::forgetKey('user_1_profile');
 
// Delete a key from a specific store
$deleted = CacheUiLaravel::forgetKey('session_data', 'redis');

Testing

composer test:unit

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

abr4xas photo

SR Backend (PHP / Laravel / WordPress) developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Abr4Xas Cache Ui Laravel Related Articles

Laravel Debugbar v4.0.0 is released image

Laravel Debugbar v4.0.0 is released

Read article
The Practical Guide to Laravel + Nova on OpenAI Codex Web image

The Practical Guide to Laravel + Nova on OpenAI Codex Web

Read article
Interactively Search and Delete Cache Keys in Laravel with Cache UI image

Interactively Search and Delete Cache Keys in Laravel with Cache UI

Read article
Dagger Components: A Powerful Alternative to Laravel Blade Components image

Dagger Components: A Powerful Alternative to Laravel Blade Components

Read article
Announcing Inertia 2.0: Redefining Frontend Development for Laravel image

Announcing Inertia 2.0: Redefining Frontend Development for Laravel

Read article
Announcing Laravel Pulse - A New Performance Monitoring Tool for Laravel Apps image

Announcing Laravel Pulse - A New Performance Monitoring Tool for Laravel Apps

Read article
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Tighten logo

Tighten

We help companies turn great ideas into amazing apps, products, and services.

Tighten
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech