cms-multi / filament-clear-cache
Clear your cache easily from within filament
Fund package maintenance!
howdu
Installs: 30 506
Dependents: 1
Suggesters: 0
Security: 0
Stars: 41
Watchers: 2
Forks: 5
Open Issues: 1
Requires
- php: ^8.1
- filament/filament: ^3.0
- filament/notifications: ^3.0
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- pestphp/pest-plugin-livewire: ^2.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
README
Add a button to easily clear the cache from your filament admin.
Compatibility
Installation
You can install the package via composer:
composer require cms-multi/filament-clear-cache
Configuration
You can publish the configuration with:
php artisan vendor:publish --provider="CmsMulti\FilamentClearCache\FilamentClearCacheServiceProvider"
Registering the plugin
use CmsMulti\FilamentClearCache\FilamentClearCachePlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentClearCachePlugin::make(), ]) }
Customizing
Under the hood optimize:clear
is called after clicking the trash button.
You may register any custom commands from inside the boot()
method of your Service Provider:
use CmsMulti\FilamentClearCache\Facades\FilamentClearCache; public function boot() { FilamentClearCache::addCommand('page-cache:clear'); }
To increment the button count call Livewire event clearCacheIncrement
.
// Livewire v2 $this->emit('clearCacheIncrement'); // Livewire v3 $this->dispatch('clearCacheIncrement')->to(\CmsMulti\FilamentClearCache\Http\Livewire\ClearCache::class);
Testing
composer test
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.