andreshg112/laravel-auditing-notifications
A Laravel package that connects Laravel Auditing with notifications, letting you alert teams when audit events occur. Configure which audits and events trigger notifications so important model changes don’t go unnoticed.
Architecture fit. This is a thin adapter, not a platform component. It sits at the seam between owen-it/laravel-auditing (the event source) and Laravel's native Notification subsystem (the delivery mechanism), translating audit records into notification payloads that can be routed through any registered channel — mail, Slack, webhooks, or a custom driver. That is a sensible seam: it consumes framework contracts (Notification, Notifiable, channel drivers) rather than inventing a transport, so it does not impose a proprietary abstraction on our codebase. For a Laravel application already running owen-it/laravel-auditing, conceptual fit is high and the blast radius is small.
Integration feasibility. Technically low-effort. Composer install, publish config, define notification classes, map audit events to notification targets. It introduces no schema of its own — it reads the existing audits table — and no new infrastructure. A realistic spike is one to three days, most of which is spent verifying version constraints against our Laravel/PHP matrix rather than writing code.
Technical risk. Risk here is dominated by project health, not code quality. Thirteen stars, a single maintainer, an archived repository, and a last release of September 2023 mean there is no forward compatibility path to current Laravel releases, no security response process, and no issue triage. Composer and most software-composition-analysis tooling will flag the package as abandoned, which is a governance gate in many organizations regardless of the code's merits. The mitigating factor is surface area: the entire capability is likely a few hundred lines, so the cost of replacing it is low and the cost of being stranded is bounded.
Key questions. Which Laravel and PHP versions are actually supported, and does the constraint set resolve against our target versions? Does it hook the auditing events or decorate the auditor directly — and does it respect per-model $auditEvents and $auditExclude configuration? What exactly is passed to the notification: the full Audit model, a DTO, or a serialized array? Are notifications queued by default, and is the queue connection configurable per notification? Is there an idempotency key so retries do not duplicate alerts? What test coverage exists, and does the test suite run against current framework versions? Does the audit payload risk leaking sensitive attribute values into email or chat channels?
Stack fit. Good, conditional on already having owen-it/laravel-auditing in place. If auditing is not yet deployed, this package adds nothing — the correct sequence is to land auditing first, establish what events matter, and only then decide how to notify. Introducing both simultaneously conflates two risk surfaces.
Migration path. I would not adopt the package as a long-lived dependency. Two viable paths: (a) fork it into an internal namespace (App\Support\AuditNotifications) so we own the compatibility surface and can patch it during framework upgrades; or (b) reimplement the equivalent as a single listener on the Audited event that dispatches a first-party notification — roughly 100–150 lines. Path (b) is my recommendation. It keeps the notification classes first-party either way, which is the important decision: if our notification classes depend only on Laravel contracts and an audit DTO we control, the driver becomes trivially swappable and the abandoned upstream stops being a strategic concern.
Compatibility. Pin explicitly and validate before committing. Run composer why-not against our target Laravel and PHP versions, confirm behavior on PHP 8.2/8.3, and check that the auditing event API it targets still matches the installed owen-it/laravel-auditing major version. Treat any successful resolution as a snapshot, not a guarantee — there will be no upstream release to fix the next framework bump.
Sequencing. (1) Confirm auditing is deployed and stable. (2) Run a time-boxed spike in a throwaway branch against pinned versions. (3) Inventory the audit events that genuinely warrant human notification — this is the real design work, and it is independent of the package. (4) Decide fork versus reimplement based on the spike's effort delta, which will likely be small. (5) Ship behind a feature flag with queued delivery and a kill switch before enabling any channel in production.
Maintenance. Effectively we inherit the codebase. Budget a small recurring line item for framework-upgrade compatibility, or eliminate it by reimplementing. Either way, assign explicit ownership; an abandoned dependency with no named owner is how silent breakage accumulates.
Support. None. No maintainer response, no upstream fixes, no community mass to draw on at thirteen stars. Internal engineering is the only escalation path, which reinforces the case for owning the code.
Scaling. The real scaling concern is not the package but the pattern it encourages: one notification per audit record. Auditing is a high-write subsystem, and naive fan-out to mail or chat will flood channels and saturate queue workers during bulk operations, imports, or batch jobs. Any production use needs queued delivery, batching or digesting, per-channel rate limits, and suppression rules for bulk-context writes. There is also a cost dimension — audit rows are already verbose, and shipping full payloads to external channels multiplies storage and egress.
Failure modes. Dispatch inside the audit transaction is the dangerous one: a synchronous notification failure could surface as a failure of the underlying business operation, turning a cosmetic alerting problem into a transactional one. Queued delivery trades that for silent loss and retry storms, so dead-letter handling and an audit-ID-based idempotency key are prerequisites, not nice-to-haves. Other failure modes: sensitive attribute values leaking into email or Slack; channel misconfiguration failing quietly with no alert on the alerting path; and schema drift after an owen-it/laravel-auditing upgrade changing the payload shape with no upstream patch to absorb it.
Ramp-up. Low for a competent Laravel engineer — half a day to a day to read the package and wire a channel — but genuine effectiveness requires understanding the auditing domain: which events fire, what triggers them, and which are worth a human's attention. That domain work, not the driver, is where the effort sits, and it is the same work required for a reimplementation.
How can I help you explore Laravel packages today?