zackaj/laravel-debounce
Debounce Laravel jobs, notifications, and (Laravel 11+) Artisan commands to prevent spamming users and queues. Uses unique job locks + cache to delay execution until activity stops. Tracks each occurrence with request metadata (IP, user) and provides reporting.
Adopt if:
Look elsewhere if:
delay seconds). Use Redis pub/sub or WebSockets for instant updates.ON DUPLICATE KEY UPDATE).*"This package lets us reduce operational noise by preventing duplicate or rapid-fire actions (e.g., notifications, background jobs) without sacrificing functionality. For example:
*"Laravel-debounce provides a batteries-included way to debounce jobs, notifications, and CLI commands using atomic locks + caching. Key benefits:
Debounce::job() or Debounce::notification()..env or config for CI/CD.Tradeoffs:
delay seconds (e.g., 5s).Example use case:
// Before: Spammy notifications
Notification::send($users, new FileUploaded($file));
// After: Debounced (1 notification per hour per user)
Debounce::notification(
notifiables: $users,
notification: new FileUploaded($file),
delay: 3600, // 1 hour
uniqueKey: $file->user_id
);
Next steps:
NotificationService or JobDispatcher classes.Call to Action: "Let’s start with [X high-impact feature] to validate the impact. I’ll prototype the integration in [Y days]."
How can I help you explore Laravel packages today?