elaborate-code/laravel-eloquent-logs
Laravel Eloquent Logs adds automatic activity logging to your Eloquent models, recording create, update, and delete events with changed attributes and the user responsible. Keep a clear audit trail of model changes with minimal setup.
Architecture fit: The package hooks into Eloquent's model event system (observers/subscribers plus a trait applied to models) and persists audit records — a standard, low-coupling integration point in Laravel. It fits any application built on ActiveRecord-style Eloquent models and does not impose a new architectural layer.
Integration feasibility: Composer install, publish config and migration, apply the trait to selected models. The 1.1.0 fixes demonstrate the package explicitly understands SoftDeletes semantics — Laravel fires updated alongside deleting/restoring for soft deletes, and deleted again on force delete. Suppressing those spurious events means teams using soft deletes (very common) get clean audit trails without writing custom event filters.
Technical risk: The core risk with any audit-log package is fidelity, and pre-1.1.0 the package produced noisy entries on soft delete, force delete, and restore. 1.1.0 corrects exactly those paths, which is the main reason this release matters to a TPM. Remaining unknowns: whether writes are synchronous (coupling audit failure to the request), whether logging participates in the parent transaction, mass-update blind spots (Eloquent mass updates bypass model events), unbounded table growth, and capture of sensitive attributes.
Key questions:
composer.json?saveQuietly / withoutEvents, multi-connection, and multi-tenant setups?Stack fit: Presumes Laravel + Eloquent. Validate Composer constraints against the host app's Laravel version before committing. Soft-delete correctness is now verified by the release notes, not assumed.
Migration path: Greenfield: install, publish config/migration, run migration, apply trait per model. No data migration required. If replacing an existing audit solution, plan dual-write and backfill rather than a hard cutover.
Compatibility: The three changes are behavioral corrections, not API or schema changes — low risk of breaking callers. The one thing to check is any test or dashboard asserting on the old noisy event counts; those expectations will shift.
Sequencing:
Maintenance: Small community package, likely a single maintainer. Low code footprint, so upgrade effort is minimal — but track releases and pin versions.
Support: Community/GitHub issues rather than commercial support. Confirm the license and whether internal fork-and-patch is acceptable.
Scaling: One write per model event; the audit table grows without bound and needs retention/archival plus index review. If the package offers queued logging, use it to keep audit writes off the request path.
Failure modes: A logging exception failing the parent write (if not caught); residual event noise (addressed in 1.1.0); missed mass updates; audit rows cascade-deleted with the parent record; PII leakage into the log table.
Ramp-up: Low for a team already fluent in Laravel conventions — trait-plus-migration is a familiar pattern.
How can I help you explore Laravel packages today?