Add a button to easily clear the cache from your filament admin.
| Plugin Version | Filament Version | PHP Version |
|---|---|---|
| 1.x | 2.x | > 8.0 |
| 2.x | 3.x | > 8.1 |
You can install the package via composer:
composer require cms-multi/filament-clear-cacheYou can publish the configuration with:
php artisan vendor:publish --provider="CmsMulti\FilamentClearCache\FilamentClearCacheServiceProvider"use CmsMulti\FilamentClearCache\FilamentClearCachePlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentClearCachePlugin::make(),
])
}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);composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
