PHPackages                             abr4xas/cache-ui-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. abr4xas/cache-ui-laravel

ActiveLibrary[Caching](/categories/caching)

abr4xas/cache-ui-laravel
========================

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

v2.1.1(2mo ago)782.6k↓11.1%2[1 PRs](https://github.com/abr4xas/cache-ui-laravel/pulls)MITPHPPHP ^8.3CI passing

Since Oct 3Pushed 1mo agoCompare

[ Source](https://github.com/abr4xas/cache-ui-laravel)[ Packagist](https://packagist.org/packages/abr4xas/cache-ui-laravel)[ Fund](https://www.paypal.com/paypalme/soyangelcruz)[ RSS](/packages/abr4xas-cache-ui-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (8)Used By (0)

![Cache UI Laravel](art/cache-ui-laravel.png)Cache UI Laravel
================

[](#cache-ui-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6683abe115876c23ef041207a92f64466c507f66e0f66bef61b6893280f07602/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616272347861732f63616368652d75692d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abr4xas/cache-ui-laravel)[![GitHub Tests Action Status](https://camo.githubusercontent.com/1ca0c77d53b367b4adbd8f34161bc6dfc7cb9bf6926e7baa312e74566dc3f45d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616272347861732f63616368652d75692d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/abr4xas/cache-ui-laravel/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a71e610974ed1565f5c2e5b79a39114c96d7e0800837cac6d250ef8ff0549ecb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616272347861732f63616368652d75692d6c61726176656c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/abr4xas/cache-ui-laravel/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/42832ecb010e43f482efae6a69ee0d3dfc2b6e12c31869a0ad9d9a4feaa0ff8a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616272347861732f63616368652d75692d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/abr4xas/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
------------

[](#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

[](#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),

    // Maximum number of keys to retrieve (null = unlimited)
    'keys_limit' => env('CACHE_UI_KEYS_LIMIT', null),

    // Enable error logging for cache operations
    'enable_logging' => env('CACHE_UI_ENABLE_LOGGING', false),

    // Timeout in seconds for cache operations (0 = no timeout)
    'operation_timeout' => env('CACHE_UI_OPERATION_TIMEOUT', 0),
];
```

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
CACHE_UI_KEYS_LIMIT=1000
CACHE_UI_ENABLE_LOGGING=true
CACHE_UI_OPERATION_TIMEOUT=30
```

### Custom File Cache Driver (Only for File Store)

[](#custom-file-cache-driver-only-for-file-store)

If you are using the `file` cache driver (default in Laravel), you should use our custom `key-aware-file` driver.

**Why?** The standard Laravel `file` driver stores keys as hashes, making them unreadable. This custom driver wraps the value to store the real key, allowing you to see and search for them.

Important

This is **NOT** needed for Redis or Database drivers, as they support listing keys natively.

#### Driver Configuration

[](#driver-configuration)

1. **Add the custom store** to your `config/cache.php` file:

```
// ... existing code ...

    'stores' => [

        // ... existing stores ...

        'file' => [
            'driver' => 'key-aware-file', // Changed from 'file' to 'key-aware-file'
            'path' => storage_path('framework/cache/data'),
            'lock_path' => storage_path('framework/cache/data'),
        ],

// ... existing code ...
```

2. **Register the custom driver** in your `AppServiceProvider`:

```
