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 Audit Laravel Package

jarek-paprocki/laravel-audit

Laravel Audit provides automatic model auditing for Laravel apps, tracking create, update, and delete events so you can see who changed what and when. It stores revisions and lets you review or revert changes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

owen-it/laravel-auditing is a model-layer instrumentation package: an Auditable trait attaches an observer to Eloquent models and writes a normalized record (event, old values, new values, actor, URL, IP, user agent, timestamps) to a configurable audit driver — database, Redis, file, or a custom driver. It is a single-purpose, low-coupling dependency: it does not own domain state, does not require a service provider of your own beyond registration, and does not impose a schema beyond its own audits table. For a Laravel monolith or modular monolith this is a clean fit for the "who changed what, when, and from where" requirement that otherwise gets hand-rolled badly.

The important architectural caveat is that the package observes Eloquent events only. Query-builder mass updates/deletes, raw SQL, DB::table() writes, and truncate operations bypass it entirely. An audit capability built on this package is therefore a model-write audit trail, not a database audit trail. That distinction must be stated explicitly to compliance stakeholders, because for many regulated use cases (SOX-style financial data, PHI) it is disqualifying without supplementary controls.

Integration feasibility

Low integration cost. Install, publish config and migrations, add the trait to in-scope models, configure $auditInclude/$auditExclude and $auditEvents, register a user resolver for non-standard auth (multi-guard, API tokens, service principals, impersonation). Custom audits via Auditable transformation hooks allow redaction and attribute normalization. No front-end, no API surface, no runtime service dependency or network hop.

Technical risk

  • Package identity mismatch — highest-priority item. The supplied package name (jarek-paprocki/laravel-audit) does not match the repository (owen-it/laravel-auditing). This is either a fork, a republish, or a metadata error. Provenance, upstream divergence, and maintenance commitment must be resolved before any code depends on it. If it is a fork, we inherit the maintenance burden for security patches.
  • Audit gap on bulk writes (above) — the primary correctness risk.
  • PII/GDPR exposure. Audit rows capture old and new values, IPs, and user agents. This creates a secondary personal-data store with its own retention, erasure, and subject-access obligations. Right-to-erasure against an immutable audit log is a known conflict and needs a legal/product decision, not an engineering one.
  • Metadata inconsistencies. Dependents: 0 contradicts a 3.4k-star, widely used package and is almost certainly a crawler artifact; the Last release: 2026-06-20 date must be validated against the real tag history.
  • Score signal. Composite score 45.3 with opportunity 5.04 reads as "mature, undifferentiated, well-served incumbent" — a build-vs-buy argument for adopting, not an adoption risk in itself.

Key questions

  1. Which package name and namespace will we actually require in composer.json, and who owns it upstream?
  2. Is the audit trail an in-scope control for any compliance framework, or an internal forensics/debugging convenience? The answer determines whether bulk-write gaps are tolerable.
  3. Who is the accountable actor model — end users only, or also jobs, console commands, and integrations?
  4. What is the retention period and the erasure policy for audit rows containing PII?
  5. Do we need tamper-evidence (hash chaining, append-only storage), or is a mutable DB table acceptable?

Integration Approach

Stack fit

Native Laravel. Requires a Laravel/PHP version matrix match — verify the constraint against our current framework version before sequencing, since this package's major versions track Laravel majors. Driver choice should default to database for consistency with business transactions; redis/file only for high-volume, non-critical logging. Compatible with morphMap if we alias model names, and with soft deletes (deleted/restored events).

Migration path

Greenfield-friendly and brownfield-tolerant: adding the trait to an existing model is non-breaking, and the audits table is additive. No backfill of historical changes is possible — the trail starts at deployment. If historical reconstruction is a requirement, that is a separate data-archaeology workstream and should be scoped out explicitly rather than assumed.

Compatibility

Watch three seams: (a) existing model observers/listeners that mutate attributes on save, which change what the audit diff records; (b) teams using DB::table() or repository patterns that already bypass Eloquent — those models will appear to have no changes; (c) existing global scopes and multi-tenancy, where the tenant identifier must be captured in the audit row or cross-tenant leakage becomes possible in shared audit tables.

Sequencing

  1. Resolve package provenance and pin an exact version (blocking).
  2. Publish config + migration in a single dedicated PR; land the schema and indexing before any model adopts the trait.
  3. Pilot on 3–5 high-value models (billing, entitlements, user roles) rather than a fleet-wide rollout — this surfaces redaction and volume issues cheaply.
  4. Implement the actor resolver, including a service/console identity convention.
  5. Add retention/partitioning job and a read API or admin surface for audit inspection — the package writes logs but deliberately does not help you consume them.
  6. Fleet rollout with per-model inclusion review signed off by the domain owner.

Operational Impact

Maintenance

Small, well-bounded surface: config, migration, and trait adoption. Ongoing cost is dominated by the audits table, not the code. Budget for schema lifecycle work — partitioning by month or an archival job — from day one; an append-only table on a transactional database is a growth problem, not a code problem.

Support

MIT license, no vendor SLA. Bus factor rests on upstream maintainers; pin versions, vendor the fork if the identity mismatch resolves to a fork, and keep an internal owner. Include the audit schema in backup/restore drills — restoring business tables without the audit table silently breaks the trail's continuity.

Scaling

Two failure modes: write amplification (every model save becomes an extra insert, inside the calling transaction by default) and read contention (reporting queries over a growing table). Mitigations: configure the package's queue support so audit writes are dispatched rather than inline — accepting the trade-off that queued audits can be lost on queue failure and may lag behind the business write. For high-write models, benchmark before rollout; a 2x write cost on a hot table is a real capacity-planning input. Also confirm the audit insert is not silently participating in and inflating rollback of business transactions.

Failure modes

  • Silent incompleteness — bulk updates, raw SQL, and models missing the trait produce no records with no error. Highest-severity, lowest-visibility risk; needs a monitoring/coverage test, not just documentation.
  • Transaction coupling — audit insert failure aborts the business write (or, if queued, divergent ordering).
  • Storage exhaustion / unbounded growth — no built-in retention.
  • Actor misattribution — unauthenticated contexts (queues, cron, webhooks) record null or a stale resolver value, which reads as "system" and defeats the trail's purpose.
  • Data leakage — a shared audit table across tenants or a table included in an over-broad export.

Ramp-up

Half a day for a competent Laravel engineer to adopt the trait and configure drivers; one to two days to do redaction, actor resolution, and coverage testing properly. Non-trivial onboarding burden sits with compliance/legal, not engineering: retention, erasure, and whether a mutable Eloquent-level log satisfies the stated control objective. Recommend a written scope statement — "model-write audit trail for forensic and internal accountability purposes; not a compliance-grade system of record" — signed before the fleet rollout, so the capability is not later oversold.

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums