Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juampi92/artisan-cache-debug
Simple artisan command to debug your redis cache. Requires PHP 8.1 & Laravel 9
https://github.com/juampi92/artisan-cache-debug
cache debug laravel php redis
Last synced: 2 months ago
JSON representation
Simple artisan command to debug your redis cache. Requires PHP 8.1 & Laravel 9
- Host: GitHub
- URL: https://github.com/juampi92/artisan-cache-debug
- Owner: juampi92
- License: mit
- Created: 2022-09-02T21:29:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T10:35:38.000Z (over 1 year ago)
- Last Synced: 2024-10-13T11:20:33.557Z (3 months ago)
- Topics: cache, debug, laravel, php, redis
- Language: PHP
- Homepage:
- Size: 196 KB
- Stars: 18
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🔎 `php artisan cache:debug`
## Simple artisan command to debug your redis cache
## 🚀 Installation
You can install the package via composer:
```bash
composer require juampi92/artisan-cache-debug --dev
```> If you would like to debug the cache in production, you can install it without the `--dev` flag.
## Usage
The simplest usage:
```php
php artisan cache:debug
```### Options
| Option / Flag | Description |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `--key=*` | Will filter the keys. Can use wildcard. Example: `--key=*:translations`. [Read more](https://redis.io/commands/scan/#the-match-option) |
| `--heavier-than[=HEAVIER-THAN]` | Will hide keys lighter than X. Use a format like `10bytes`, `1kb`, `8b` |
| `--sort-by[=SORT-BY]` | Will sort the keys by `size` or `key`. *[default: "size"]* |
| `--sort-dir[=SORT-DIR]` | Set the sorting direction: `asc` or `desc`. |
| `--forever` | Will **only** show non-expiring keys. |
| `--with-details` | Show the type of every cache record. |
| `--store=` | In case you want to debug a cache store other than the default. |## Testing
```bash
sail up -d
composer test
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### To-do
Some ideas to expand this package:
- [ ] Pagination
- [ ] Filter on type
- [ ] Display the TTL (currently can't make it fit in the results)
- [ ] Support memcache?## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Juan Pablo Barreto](https://github.com/juampi92)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.