quarks/laravel-auditors
quarks/laravel-auditors is a Laravel package for tracking changes to Eloquent models, recording who made updates and what changed. It helps you add an audit trail to your application with minimal setup, so you can review model activity and keep a history of edits.
Architecture fit: The package targets a common Laravel concern: attributing Eloquent writes to the authenticated user via created_by, updated_by, and deleted_by. Its likely trait/observer-based design fits standard Laravel monoliths and simple service architectures. It is not a full audit-log solution — it records attribution, not before/after values, request context, or tamper-evident history. For compliance-grade auditing, it should be paired with an immutable audit trail or treated as a UX/operational aid only.
Integration feasibility: Feasible for a Laravel team: add a trait, publish/add nullable user-reference columns, configure the auth resolver, and validate model event coverage. The main unknowns are Laravel/PHP version support, user key types (integer vs UUID/ULID), multi-guard auth, and behavior under queued jobs, console commands, and bulk operations. With only 3 stars, 0 dependents, and a last release in January 2022, treat the package as a reference implementation or internal fork rather than a strategic dependency.
Technical risk: High maturity risk relative to production-critical use. Low adoption, stale release cadence, and no visible ecosystem mean Laravel 10/11/12 compatibility is unproven. Eloquent event-based attribution can silently miss mass updates, direct DB writes, cascading deletes, and unauthenticated background jobs. Schema changes across many tables require careful migration/backfill. MIT licensing is favorable, but maintainer continuity and security responsiveness are unverified.
Key questions: Which Laravel and PHP versions are supported and tested? How is the acting user resolved for API tokens, multiple guards, impersonation, and queued jobs? Does it support UUID/ULID foreign keys and multi-tenant user models? How are soft deletes, hard deletes, restore, and force-delete handled? Are bulk updates and direct database changes in scope? What is the backfill policy for existing rows? Is the audit data expected to be immutable, retained, and reportable under legal/privacy requirements? Who owns the fork and upgrade path?
Stack fit: Best fit is a conventional Laravel application using Eloquent models, standard auth guards, and MySQL/PostgreSQL. It is less suitable for event-sourced systems, polyglot write paths, or organizations requiring formal audit controls. Use it where “who touched this record” is valuable for operations, support, and lightweight governance.
Migration path: Fork the package into an internal namespace and pin the source commit. Add migrations for nullable created_by, updated_by, and deleted_by columns using the correct user key type. Backfill existing rows with null or a documented system user. Apply the trait to low-risk models first, then expand after event-path testing.
Compatibility: Validate Composer constraints against the target Laravel/PHP matrix. Test API-token auth, session auth, queued jobs, scheduled commands, seeders, and impersonation. Confirm behavior with soft deletes and cascading foreign keys. If the package is incompatible, implement a small internal observer/trait rather than patching a stale dependency deeply.
Sequencing: Run a short discovery spike; fork and add CI tests; define attribution semantics with product/security; migrate schema and backfill; integrate on pilot models; test all write paths including bulk operations; instrument for null or unexpected actor IDs; then roll out model-by-model. Avoid a big-bang rollout across every table.
Maintenance: Internal ownership is required. Expect to maintain compatibility through Laravel upgrades and to review Eloquent lifecycle behavior. The package’s age and low adoption make community maintenance unreliable; budgeting a small internal fork is more realistic than assuming upstream support.
Support: No commercial SLA or broad community support should be assumed. Support burden is low technically but non-zero operationally: teams will ask why an actor is null, why a bulk update was missed, or why a deleted record shows a different actor than expected. Document resolver behavior and fallback rules.
Scaling: Runtime overhead is likely modest: extra columns and model event listeners per write. The greater scaling concern is reporting and retention — attribution columns on high-volume tables can grow, and audit queries may need indexes. Validate under high-write workloads and avoid using this as the sole audit store for regulated data.
Failure modes: Missing auth context in jobs/CLI yields null or incorrect actors. Bulk query-builder updates bypass model events. Direct SQL writes bypass attribution. Soft-delete/restore/force-delete semantics may be ambiguous. Multi-tenant or impersonation flows can misattribute actions. Cascading deletes can create attribution gaps. Plan monitoring for null actor rates and documented exceptions.
Ramp-up: Laravel developers can integrate this quickly — likely hours to days for a pilot. Product, security, and legal stakeholders need more time to define what “created by” means, retention expectations, and whether attribution alone satisfies audit requirements. Overall, leverage this package as a small internal capability, not as a compliance system of record.
How can I help you explore Laravel packages today?