Filament Cache Manager is a FilamentPHP plugin that allows you to easily clear your Laravel application cache directly from the Filament admin panel.
Install via Composer:
composer require binarybuilds/filament-cache-managerRegister the plugin in your panel service provider:
use BinaryBuilds\FilamentCacheManager\FilamentCacheManagerPlugin;
$panel->plugin(FilamentCacheManagerPlugin::make());Restrict who can access the plugin:
FilamentCacheManagerPlugin::make()
->canAccessPlugin(fn () => Auth::user()->role === 'Admin');Restrict who can use the Forget Key action:
FilamentCacheManagerPlugin::make()
->canForgetKey(fn () => Auth::user()->role === 'Admin');Restrict who can use the Flush Cache action:
FilamentCacheManagerPlugin::make()
->canFlushCache(fn () => false);Change navigation label:
FilamentCacheManagerPlugin::make()
->navigationLabel('Cache');Change navigation icon:
use Filament\Support\Icons\Heroiconl
FilamentCacheManagerPlugin::make()
->navigationIcon(Heroicon::CpuChip);Change navigation group:
FilamentCacheManagerPlugin::make()
->navigationGroup('Settings');Display common cache keys as cards with title, description, and optional status color:
FilamentCacheManagerPlugin::make()
->addCacheKey(
'homepage',
'Homepage Cache',
'Clear this cache if the content on the homepage is out of date.'
)
->addCacheKey(
'layout',
'Layout Cache',
'Clear this cache if you recently made changes to menu items. Beware! this might cause a temporary slowness to the application.',
'danger'
)
->addCacheKey(
'settings',
'Settings Cache',
'Clear this cache if you recently updated site settings'
)
->addCacheKey(
'articles',
'Articles Cache',
'Clear this cache if you added or updated articles and your changes are not reflecting on the site.'
);Control the number of columns used to display the predefined cache key cards:
FilamentCacheManagerPlugin::make()
->columns(3);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.
