filament-clear-cache
filament-clear-cache copied to clipboard
[Question] - Dispatch Event
Related to:
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);
From where it needs to dispatch the event? I am sorry, I haven't got it.
Thank you
Depends where you wanted to increment number e.g after a resource has been deleted, but it could be anywhere that Livewire is used.
We use it after most Filament actions using configurable to save littering the code base
The service class
I've completely misunderstood the scope of that counter. Sorry about that. I will try to better understand how and when I can use the dispatch.
@cms-multi Honestly, I didn't understand what's the purpose of this counter. Thanks