- How do I install and set up laravel-notification-channel-throttling in my Laravel app?
- Install it with composer require syropian/laravel-notification-channel-throttling, then reference the package's throttling channel in the via() method of each notification you want to limit. Throttle windows and caps are expected to be configured in code or a config file rather than through migrations. Check the README for the exact channel class name and config keys, since the v1.0.3 release notes do not document them.
- Does this package support Laravel 13 and older Laravel versions?
- Version 1.0.3 added Laravel 13 support, so the package is being kept current with new framework majors. Whether older illuminate versions are still supported is not verifiable from the supplied evidence, so read the composer.json constraints before assuming your Laravel version is covered. Because framework support arrived as a patch bump, budget a compatibility check on each Laravel major upgrade.
- How do I configure per-channel throttle limits on my notifications?
- Limits are applied per channel or per notifiable, which lets you cap mail differently from SMS or database notifications while keeping your existing notification workflow intact. Configuration is expected to live in code or config rather than the database. Verify the exact key names and whether a limit accepts a count plus a time window before rolling it out.
- Is the throttle atomic when multiple queue workers send at the same time?
- This is the single most important thing to verify before relying on the package. Cache-based throttles are commonly implemented as a read-then-write, which is not atomic, so concurrent workers can over-send and exceed the cap instead of under-sending. Check whether the implementation uses atomic increments or locks, because that determines whether the limit is enforceable or merely advisory.
- How is the throttle key scoped: per notifiable, per channel, or per notification class?
- Keying determines whether a password reset can be silently swallowed by an earlier weekly digest, so confirm the scope first. The package may key on the notifiable only, the notifiable plus channel, or the notifiable plus notification class. If the scope is broader than you need, apply the throttling channel selectively rather than to every notification.
- Does throttling happen when the notification is dispatched or when the queue worker sends it?
- Suppression at dispatch time occurs before the job is queued, while suppression at send time occurs inside the worker, and the two behave differently under queue backlog and retries. Dispatch-time checks are cheaper but can drop notifications queued during a burst. Confirm which behaviour applies so you know whether retried jobs count against the limit.
- What happens if the cache store is unavailable: does it fail open or fail closed?
- This must be a deliberate product decision rather than a default. Failing open means notifications send anyway and the throttle is bypassed, which is usually safer for user-facing alerts. Failing closed means notifications are dropped, which may be unacceptable for password resets or security alerts, so test the behaviour in staging.
- Do I need a database migration or a specific cache driver like Redis?
- No migrations are anticipated, but if the package stores counters in the application cache then your cache driver becomes a hard runtime dependency. The database cache driver would add write load and depend on the cache table, so Redis or Memcached is the sane target. Whatever you choose must be shared across all app servers and queue workers, otherwise each process throttles independently.
- How do I test that a notification is actually throttled in my test suite?
- Dispatch the same notification twice inside the window and assert the second is suppressed, then travel past the window and assert it sends again. Use Notification::fake() to capture what was actually delivered per channel. If your tests run queue workers, use the sync queue or a shared array cache so both dispatches see the same throttle state.
- Is this package safe to depend on in production, and what are the alternatives?
- It is a single-maintainer convenience layer, and v1.0.3 is a patch release that adds a new framework major, so pin an explicit version in composer.json rather than relying on a caret range. That risk is acceptable for a convenience throttle but not for compliance-driven send limits. For provider quotas or true distributed rate limiting across services, use queue middleware or infrastructure-level limiting instead of a notification channel.