cms-multi/filament-clear-cache
Adds a “Clear Cache” button to your Filament admin toolbar so you can quickly run cache-clearing commands without leaving the panel. Supports Filament v2–v5 (via plugin versions) and configurable via a publishable config.
optimize:clear command, which clears route, config, and view caches. This is a low-risk approach since it uses native Laravel functionality.page-cache:clear), allowing TPMs to extend functionality for project-specific caching needs (e.g., Redis, Varnish, or custom cache stores).panel() method).optimize:clear suffice, or are custom commands required?enabled() method.)composer require cms-multi/filament-clear-cache
php artisan vendor:publish --provider="CmsMulti\FilamentClearCache\FilamentClearCacheServiceProvider"
app/Providers/Filament/AdminPanelProvider.php:
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
FilamentClearCachePlugin::make()
->enabled(app()->environment(['local', 'staging'])),
]);
}
use CmsMulti\FilamentClearCache\Facades\FilamentClearCache;
public function boot()
{
FilamentClearCache::addCommand('page-cache:clear');
}
enabled() method) unless cache clearing is a manual requirement.panel() registration and Filament version compatibility.optimize:clear permissions (e.g., storage directory writable).php artisan optimize:clear manually to test cache clearing.storage/logs/filament.log) for plugin errors.optimize:clear rebuilds route/config/view caches, which may cause brief latency spikes (mitigated by Filament’s session management).| Failure Scenario | Impact | Mitigation | |-------------------------------------|
How can I help you explore Laravel packages today?