Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Auditing Laravel Package

owen-it/laravel-auditing

Laravel Auditing keeps a history of changes to your Eloquent models using a simple trait. Easily retrieve audited data to track discrepancies, anomalies, and suspect activity, and display detailed model change logs in your Laravel application.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package is a thin, trait-based cross-cutting concern that hooks Eloquent's model event lifecycle (created, updated, deleted, restored, retrieved) rather than requiring a repository layer, base-model inheritance, or service wrapping. Integration is opt-in per model via OwenIt\LaravelAuditing\Contracts\Auditable + the Auditable trait, which means we can scope rollout to regulated or high-risk entities (billing records, user roles, permission grants) without touching domain code. Extensibility is via contracts — AuditDriver, UserResolver, IpAddressResolver, UrlResolver, UserAgentResolver, AttributeRedactor, AttributeModifier, AttributeEncoder — so audit sinks and PII masking are substitutable at the container level. That is the right shape for a platform capability, not a library we hard-fork.

Integration feasibility. Low-friction: one Composer dependency, one published config, one published migration, one trait. No external infrastructure required for the default database driver, which is decisive for us versus standing up a CDC pipeline (Debezium/Kafka) or a bespoke observer framework. The version matrix is the main gate: v14.x targets Illuminate 11–13 and PHP ≥ 8.2, so our Laravel/PHP baseline determines whether we're on an actively supported line or an EOL one (13.x and below are explicitly EOL). Custom Audit model support and morph map awareness matter for us because we use morphMap and would inherit broken polymorphic resolution otherwise.

Technical risk. Ranked:

  • Write amplification, not correctness. Every audited event is an extra INSERT on the request path, inside the same transaction by default. On hot tables this is a measurable latency and connection-pool cost; async/queue logging exists (and had a fix in v14.0.6) but introduces ordering and loss semantics we must choose deliberately.
  • PII residency. Full attribute payloads (old/new values plus URL, IP, user agent) land in our database, inheriting its retention, backup, and residency scope. Redaction is opt-in via attribute-level config, so an unredacted default is the realistic failure state. This is a compliance surface, not a bug.
  • Unbounded growth. The package gives us prune() on the database driver and little else. Partitioning, archival, and retention are our problem, and they must be designed before the table crosses ~10^8 rows.
  • Maintainer concentration. High star count (3.4k) but a small active maintainer set; one or two people carry the release cadence. Majors track Laravel majors, so upgrade work is coupled to framework upgrades.
  • Data-quality caveats. Dependents: 0 and a last-release date of 2026-11-02 are both inconsistent with the observed ecosystem and changelog; treat the metadata as unreliable and validate adoption through Packagist download stats and our own peer network before citing it in a business case. Score 64.3 with opportunity 50.5 signals a mature incumbent in a commoditized category — defensible default choice, weak strategic differentiation.

Key questions.

  1. Which entities are in scope for phase 1, and is there a regulatory driver (SOX/PCI/HIPAA/GDPR) that sets the retention and immutability bar?
  2. Do we need tamper-evidence (hash chaining, append-only sink), or is "audit trail with DB-level access control" sufficient? The package does not provide the former.
  3. Which writes are on the critical path, and what is our p95 latency budget per audited request?
  4. Sync or queued auditing — and can we tolerate lost audit rows on queue failure for any in-scope entity?
  5. Is the audits table in the same database/region as the source data, or does it need to live in a separate compliance store?
  6. What is our Laravel upgrade cadence, and will we keep pace with the package's major releases or pin and defer?

Integration Approach

Stack fit. Laravel 11+ / PHP 8.2+ on v14.x is the only combination I would approve. Anything below means adopting an EOL line with no security backports — that is a hard stop for an audit capability, since the audit trail's evidentiary value depends on the library being maintained. Confirm no Lumen remnants; Lumen support is legacy and not a target.

Migration path. If we are already on v13.x or earlier, treat the v14 upgrade as a separate, pre-approved work item (PHP floor bump, config key changes such as the exclude default and dynamic resolver registration) before enabling auditing on new models. If greenfield, install at v14 and pin to ^14.0 with a renovate/dependabot policy that allows patches automatically and gates minors/majors behind a test pass. Do not hand-roll an observer-based alternative: the resolver/redactor contract set is the part we would otherwise rebuild badly.

Compatibility. Verify: JSON column support on our engine (MySQL 5.7+/8.x, Postgres JSONB), morphMap alignment between audited models and the audits polymorphic columns, custom primary/foreign key config for the User resolver if we use UUIDs, and multi-database setups (audit connection vs. model connection). If we run read replicas, confirm audits write to the primary. If we use soft deletes plus restored, note the v14.0.4 fix around restore events stopping other update listeners — pin at ≥14.0.4.

Sequencing.

  1. Publish config and migration; review the migration against our schema standards (indexes on auditable_type, auditable_id, event, created_at; consider partitioning key upfront).
  2. Define the redaction policy and implement AttributeRedactor mappings for secrets, tokens, and personal data before the first audited write. Retrofitting redaction leaves unredacted history behind.
  3. Instrument one low-blast-radius model in staging; measure insert overhead, row size, and index growth under realistic volume.
  4. Enable phase-1 entities in production behind a per-environment config toggle (auditing can be globally disabled), with console/CLI contexts explicitly reviewed since the user resolver returns null there.
  5. Build retention/archival job and alerting on growth before phase 2.
  6. Expose read paths (admin change history, transitionTo() for workflow timelines) as a product surface after the data layer is trusted.

Operational Impact

Maintenance. MIT license, no procurement friction, no vendor relationship. Steady state cost is modest: patch upgrades, plus a major upgrade every time Laravel ships one. Budget for a named owner — audit trail semantics are a compliance artifact and need a human accountable for retention and redaction drift when new columns are added to audited models.

Support. Documentation site plus in-repo guide, changelog and release notes with PR-level detail, and a Discord. No commercial SLA. That is acceptable for an internal capability where we can read the source and pin versions, but it means our own runbook — not upstream — is the escalation path. Track upstream issues for our specific drivers; the changelog shows a healthy fix cadence on real production bugs (async logging, reflection/PHP 8.5, restore event handling).

Scaling. The audits table becomes one of the largest in the schema and is read rarely but written constantly. Plan for: partitioning by created_at, archival to cold storage (S3/Parquet) or a dedicated analytics store, prune() on a schedule with a documented retention window, and separate connection/IO budget so audit writes cannot starve transactional workloads. For async mode, size the queue and workers against peak write rate and define a dead-letter path — an audit row that silently vanishes is worse than a slow request.

Failure modes.

  • Audit insert fails inside the request transaction → whole business operation rolls back. Decide explicitly whether audit failure should block the write; the conservative default is yes for in-scope entities, but it converts an audit outage into an application outage.
  • JSON payload exceeds column limits on wide models → truncated or failed writes; enforce a column type and monitor payload size.
  • Resolver exceptions (user, IP, URL, user agent) in unusual contexts — queues, console, jobs — degrade or null out attribution; the audit row exists but is unattributable, which quietly undermines the trail.
  • Async/queue drift: events reordered or dropped relative to source commits, producing gaps that are hard to distinguish from tampering.
  • Redaction gaps after schema changes: new sensitive columns added to an audited model are recorded in cleartext until someone updates the redactor.

Ramp-up. Engineering ramp is near-zero — one trait, one config file, idiomatic Laravel, and the docs cover the common cases. The real ramp is organizational: legal/compliance sign-off on retention, redaction, and access control; security review of the audits table permissions; and admin UX for reading change history. Budget the majority of effort there rather than in integration. Recommend a two-sprint path: sprint 1 for install, redaction policy, and staging measurement; sprint 2 for phase-1 production enablement plus retention job and growth alerting.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections