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

Version-Controlled Documentation Inside Your Laravel App with Laradocs image

Version-Controlled Documentation Inside Your Laravel App with Laradocs

Read article
Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel image

Drag-and-Drop Sorting for Eloquent Models with Reorderable for Laravel

Read article
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
The Certification of Competence for Laravel logo

The Certification of Competence for Laravel

A community-driven, proctored assessment across 4 levels designed to validate real-world Laravel knowledge, from Junior to mastery-level Artisan. Official Vue.js, Official Nuxt, Angular, React, JS certifications also available.

The Certification of Competence for Laravel
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Lucky Media logo

Lucky Media

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

Lucky Media
Tighten logo

Tighten

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

Tighten
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