jeffersongoncalves/filament-refresh-sidebar
ResourceUpdated, NotificationReceived)?event(new SidebarRefreshEvent())).composer require jeffersongoncalves/filament-refresh-sidebar
php artisan vendor:publish --provider="JeffersonGoncalves\FilamentRefreshSidebar\FilamentRefreshSidebarServiceProvider"
SidebarRefreshEvent in EventServiceProvider.public function boot(): void {
SidebarRefresh::listen(function () {
// Custom logic (e.g., fetch updated badge counts)
});
}
sidebar-refresh events (handled by the package).Cache-Control: no-cache for dynamic routes).assertSidebarBadgeCount() helper).SidebarRefreshEvent to debug sync failures:
SidebarRefresh::listen(fn () => Log::debug('Sidebar refreshed at', ['time' => now()]));
sidebar:refresh API endpoint with proper auth middleware.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Event listener not triggered | Stale sidebar | Add health checks for event dispatching. |
| Frontend event listener broken | Silent UI updates | Feature flags to toggle sidebar refreshes. |
| Database query timeout | Partial sidebar updates | Implement retry logic with exponential backoff. |
| Filament version mismatch | Package incompatibility | Pin Filament to a specific minor version. |
| High-frequency refreshes | UI jank | Throttle events (e.g., debounce with Laravel\Echo). |
UserUpdated, NotificationCreated).How can I help you explore Laravel packages today?