alkhachatryan/laravel-loggable
Laravel Loggable automatically tracks model changes, recording who created, updated, or deleted records along with the before-and-after data. A lightweight activity log for Eloquent models, it helps you audit changes and debug issues without extra setup.
Architecture fit
laravel-loggable is an Eloquent-lifecycle package: you attach a trait to models, and it hooks created/updated/deleted events to write change records "in multiple ways" (driver-style: database, file, etc.). That fits a Laravel monolith or modular monolith where the audit trail is a first-class domain concern and all writes flow through Eloquent.
It does not fit:
DB::table(), upsert(), raw SQL, bulk imports) — those paths produce silent audit gaps by design, not by bug.Integration feasibility The gating constraint is not the code, it's the metadata: archived, last release 2020-02-10, 57 stars, health score 0.2175. A February 2020 release predates Laravel 7 and targets roughly PHP 7.2–7.4 / Laravel 5.8–6.x. On Laravel 10/11/12 (PHP 8.1+) the Composer constraint will almost certainly refuse to resolve. Confirm this first — it collapses the build-vs-adopt decision to "adopt" only if you're on a legacy stack.
The upside: the package is small (a trait plus a handful of driver classes) and MIT-licensed, so fork-and-vendor is genuinely cheap — days, not weeks. Treat it as source code you acquire, not a dependency you consume.
Technical risk — High
$casts, JSON columns, pivot writes, mass updates) are unlikely to have been exercised.Key questions to resolve before any code is written
composer require resolve at all?spatie/laravel-activitylog or owen-it/laravel-auditing against these requirements?Stack fit
Binary. If the app is on Laravel ≤6 / PHP ≤7.4, fit is straightforward and the only work is hardening. If the app is on Laravel 9+, fit is zero without a fork — do not attempt --ignore-platform-reqs, that just defers a runtime failure into production.
Migration path Recommendation, in priority order:
packages/laravel-loggable, register as a Composer path repository, and take ownership.dev-master dependency against an archived repo.Compatibility work for a fork
composer.json constraints to php: ^8.1|^8.2 and laravel/framework: ^10|^11.getDirty(), getOriginal(), getChanges(), event dispatcher signatures, HasAttributes.jsonb), and that diff payloads are size-capped.Sequencing
Maintenance Ownership transfers entirely to your team. Budget roughly 1–2 engineer-days per Laravel major upgrade plus ad-hoc PHP deprecation fixes, and accept that there is no upstream to patch a CVE. Contrast this with a maintained alternative where the same budget buys a version bump.
Support No maintainer, no issue triage, no community. Internal runbook and inline documentation of the driver configuration are mandatory — the "multiple ways" config surface is the part future engineers will misconfigure.
Scaling The audit table becomes the fastest-growing table in the schema — commonly 5–20× the write volume of its source models, and diff payloads make rows wide. Three consequences:
Failure modes, ranked by severity
upsert, seeders, queue jobs using DB::table(), and soft-delete restores. Unknowable after the fact; enumerate paths up front.Ramp-up Low technical ramp for any Laravel developer — traits and model observers are familiar patterns, roughly half a day. The real ramp is organizational: defining what "logged" means, which models are in scope, and who owns retention. That work is the same regardless of package, which is precisely why the package choice should default to the maintained option.
How can I help you explore Laravel packages today?