Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Clear Cache Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Filament Plugin Integration: The package is a Filament-specific plugin, leveraging Filament’s plugin system (v2.x–v5.x) to inject a cache-clearing UI element into the admin panel. This aligns well with Laravel applications using Filament for admin interfaces, as it avoids manual CLI access for cache management.
  • Laravel Cache Abstraction: Under the hood, it uses Laravel’s built-in optimize:clear command (or custom commands), ensuring compatibility with Laravel’s caching mechanisms (Redis, Memcached, file-based, etc.).
  • Non-Invasive: The plugin does not modify core Laravel/Filament logic; it extends functionality via Filament’s plugin system, reducing risk of conflicts.

Integration Feasibility

  • Low Coupling: The package requires minimal changes to existing codebases—only a single line to register the plugin in the panel() method of a Filament service provider.
  • Configuration Flexibility: Supports:
    • Environment-based activation (e.g., disable in production).
    • Custom cache commands (e.g., page-cache:clear).
    • UI customization (e.g., translations, button visibility).
  • Filament Version Support: Actively maintained for Filament v3–v5, with PHP 8.1+ support. Critical for TPMs: Verify your Filament version matches the package’s compatibility table (e.g., v3.x for Filament 3.x).

Technical Risk

  • Dependency Risk: Relies on Filament’s plugin system. If Filament undergoes breaking changes (e.g., plugin registration methods), the package may require updates. Mitigation: Monitor Filament’s release notes and test upgrades.
  • Performance Impact: Clearing cache via UI triggers a full optimize:clear, which can be resource-intensive. Mitigation:
    • Restrict to non-production environments (default behavior).
    • Add rate-limiting or confirmation dialogs for sensitive actions.
  • Livewire Compatibility: Uses Livewire events for UI updates. Ensure your Filament version supports the Livewire version used by the package (v2/v3).
  • Custom Commands: Adding custom commands (e.g., page-cache:clear) requires ensuring those commands exist in your Laravel app. Risk: Broken links if commands are undefined.

Key Questions for TPMs

  1. Filament Version Alignment:

    • What version of Filament is your admin panel using? Does it match the package’s supported range (e.g., v3.x for Filament 3.x)?
    • Example: If using Filament v2.x, this package won’t work without a fork or downgrade.
  2. Cache Strategy:

    • Does your app use non-standard cache commands (e.g., custom cache:clear logic)? If so, will the package’s default optimize:clear suffice, or do you need to extend it?
    • Example: If using a microservice-based cache (e.g., Varnish), you may need to add a custom command.
  3. Environment Safety:

    • Should the cache-clear button be disabled in production? The package supports this via ->enabled(App::environment(['local', 'staging'])).
    • Example: Add a feature flag or environment check to prevent accidental production cache clears.
  4. UI/UX Impact:

    • Will the button clutter the admin toolbar? The package hides it on "simple pages" (configurable), but test in your Filament layout.
    • Example: Customize visibility via the visible config option.
  5. Monitoring:

    • How will you track cache-clear usage? The package emits a clearCacheIncrement Livewire event—can this be logged or tied to analytics?
    • Example: Extend the event to trigger a custom analytics call.
  6. Rollback Plan:

    • If cache clearing breaks functionality (e.g., due to stale cached data), how will you revert? The package doesn’t provide undo functionality—plan for manual rollback or backup strategies.

Integration Approach

Stack Fit

  • Primary Use Case: Laravel applications using Filament v3–v5 for admin panels.
  • Secondary Use Case: Teams that want to centralize cache management in the UI rather than relying on CLI commands (e.g., php artisan cache:clear).
  • Non-Fit Scenarios:
    • Non-Filament Laravel apps (requires a different UI integration).
    • Apps using custom cache backends without Laravel’s optimize command.

Migration Path

  1. Prerequisites:

    • Ensure your Laravel app meets the PHP version requirement (e.g., PHP 8.2+ for Filament v4/5).
    • Verify Filament version compatibility (check the compatibility table in the README).
  2. Installation Steps:

    composer require cms-multi/filament-clear-cache
    php artisan vendor:publish --provider="CmsMulti\FilamentClearCache\FilamentClearCacheServiceProvider"
    
    • TPM Note: Add this to your composer.json under require-dev if cache clearing is a dev-only feature.
  3. Plugin Registration: Modify your Filament panel configuration (e.g., app/Providers/Filament/AdminPanelProvider.php):

    public function panel(Panel $panel): Panel {
        return $panel
            ->plugins([
                FilamentClearCachePlugin::make()
                    ->enabled(App::environment(['local', 'staging'])),
            ]);
    }
    
    • TPM Note: Use the enabled() method to restrict access to specific environments.
  4. Customization (Optional):

    • Add Custom Commands:
      use CmsMulti\FilamentClearCache\Facades\FilamentClearCache;
      
      public function boot() {
          FilamentClearCache::addCommand('page-cache:clear');
      }
      
    • UI Tweaks: Publish the config file (config/filament-clear-cache.php) to adjust button visibility, translations, or session keys.
  5. Testing:

    • Test in a staging environment to ensure:
      • The button appears/disappears as expected.
      • Cache clearing works without breaking functionality (e.g., check for stale cached data).
      • Custom commands (if added) execute correctly.

Compatibility

  • Filament Versions: Explicitly tested for v3–v5. TPM Action: Pin the package version in composer.json to avoid auto-upgrades that might break compatibility.
    "cms-multi/filament-clear-cache": "^3.0"
    
  • PHP Versions: Requires PHP 8.1+ (higher for newer Filament versions). TPM Action: Audit your PHP version and Laravel compatibility.
  • Cache Drivers: Works with Laravel’s default cache drivers (Redis, file, database). TPM Action: Test with your specific cache backend (e.g., Redis clusters).

Sequencing

  1. Phase 1: Dev/Staging Rollout

    • Install and test in non-production environments first.
    • Monitor for:
      • UI rendering issues (e.g., button placement).
      • Performance impact during cache clears.
  2. Phase 2: Production Considerations

    • Disable in Production: Use ->enabled() to restrict access.
    • Add Safeguards:
      • Implement a confirmation dialog before clearing cache (customize via the plugin’s config).
      • Log cache-clear events for auditing (extend the Livewire event).
    • Documentation: Update your team’s runbook with cache management procedures.
  3. Phase 3: Customization (If Needed)

    • Extend the plugin for additional cache commands or analytics.
    • Contribute back to the package if changes are broadly useful.

Operational Impact

Maintenance

  • Package Updates:
    • The package is actively maintained (last release: 2026-05-13), with a clear changelog and releases section.
    • TPM Action: Subscribe to release notes and test updates in a staging environment before upgrading.
  • Dependency Management:
    • The package has no external dependencies beyond Filament and Laravel, reducing maintenance overhead.
    • TPM Action: Monitor Filament’s major version updates, as they may require package updates.

Support

  • Troubleshooting:
    • Common issues (e.g., button not appearing) are likely due to:
      • Incorrect Filament version.
      • Misconfigured plugin registration.
      • Missing custom commands.
    • TPM Action: Document a troubleshooting checklist for your team, including:
      • Verifying Filament version compatibility.
      • Checking config/filament-clear-cache.php for overrides.
      • Ensuring custom commands exist in app/Console/Kernel.php.
  • Community Support:
    • GitHub Issues: 53 stars and active contributions suggest a responsive community. TPM Action: Open issues for edge cases (e.g., custom cache backends).
    • No Official Support: As an open-source package, support is community-driven. TPM Action: Allocate time for debugging if critical.

**

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky