PHP code example of cms-multi / filament-clear-cache

1. Go to this page and download the library: Download cms-multi/filament-clear-cache library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cms-multi / filament-clear-cache example snippets


use CmsMulti\FilamentClearCache\FilamentClearCachePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentClearCachePlugin::make(),
        ])
}

use CmsMulti\FilamentClearCache\Facades\FilamentClearCache;

public function boot()
{
    FilamentClearCache::addCommand('page-cache:clear');
}

// Livewire v2
$this->emit('clearCacheIncrement');

// Livewire v3
$this->dispatch('clearCacheIncrement')->to(\CmsMulti\FilamentClearCache\Http\Livewire\ClearCache::class);
shell
php artisan vendor:publish --provider="CmsMulti\FilamentClearCache\FilamentClearCacheServiceProvider"