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

Elogquent Laravel Package

luissantiago/elogquent

Elogquent is a Laravel package for logging Eloquent model events. Add its trait to models to automatically record create, update, and delete actions—including changed attributes—for simple auditing and activity history.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • The package targets a narrow, well-understood concern: model-level change capture (audit/history) in Laravel applications. If our product roadmap includes compliance-driven audit trails, "who changed what when" for regulated customers, or internal investigation tooling, this is architecturally aligned with a standard Eloquent-centric Laravel codebase.
  • One row per changed attribute is the key architectural decision. It optimizes for queryability ("show me every change to field X") and audit readability, but trades against write amplification and table growth. This is the same trade-off owen-it/laravel-auditing makes and the opposite of spatie/laravel-activitylog's coarse per-event record. For a high-write transactional system (orders, ledger entries, IoT ingestion), this is a material design constraint; for CRUD-style admin/B2B SaaS data, it is a good fit.
  • Because it hooks Eloquent model events rather than the query builder, it inherits the standard Laravel blind spot: DB::table()->update(), bulk upserts, raw SQL, and queue workers writing outside the ORM will not be captured. Any architecture that relies on bulk operations must account for that gap explicitly — otherwise the audit trail is silently incomplete, which is worse than no audit trail in a compliance context.

Integration feasibility

  • Integration is expected to be low-friction in the Laravel idiom: install via Composer, publish a migration/config, add a trait or implement an interface on tracked models, declare the tracked attribute list. That is a 1–3 day spike for a single senior Laravel engineer, including verification of actual behavior rather than trust in the README.
  • The hard part is not wiring; it is the decisions preceding wiring: which models are in scope, which attributes are sensitive (PII, secrets, tokens, passwords), what retention window is acceptable, and who is allowed to read the history table. Those are product/compliance decisions, not engineering ones, and they gate the work.

Technical risk

  • Maturity. 19 stars is a strong signal of low adoption. There is no meaningful community to surface edge cases, no battle-testing against unusual schema types, and a realistic bus-factor of one. Apache-2.0 licensing is permissive and safe, but permissive licensing does not mitigate abandonment.
  • Semantic risk on attribute capture. Casts, mutators/accessors, JSON columns, encrypted casts, date normalization, and $dirty/$original divergence can all produce history records that are technically accurate but misleading to a human reader (e.g., raw encrypted blobs, or a JSON column recorded as one opaque string). Needs empirical validation against our actual models.
  • Event coverage gaps. Soft deletes, restore, force delete, updateQuietly(), saveQuietly(), observers that themselves mutate models (recursion risk), and nested transactions are all places where naive event hooks break or double-count.
  • Transaction coupling. If history writes are synchronous and in the same transaction as the domain write, an audit-table failure rolls back the business operation — a hard availability coupling. If they are async, we accept eventual consistency and possible loss on worker failure. Neither default should be assumed; this must be chosen deliberately.
  • Version drift. Laravel majors ship annually and Eloquent internals shift. A single-maintainer package with no CI matrix visible is likely to lag. Budget for the possibility of forking.

Key questions

  1. Does the package expose a stable, documented contract (trait/interface/config) that we can wrap behind our own internal AuditLogger abstraction so we can swap implementations later without touching domain code?
  2. Is history writing synchronous or queueable, and can it be made transactional-independent?
  3. How does it handle deleted_at/soft deletes, restores, and force deletes?
  4. What is the row shape — does it store old value, new value, both, the actor, the request/IP, and a correlation/request ID? Actor attribution is usually the single most important field for the business and often the one audit packages leave to the consumer.
  5. Is there any redaction/exclusion mechanism for sensitive attributes, or is that entirely on us?
  6. Are there tests and a CI matrix covering supported PHP/Laravel versions? What is the actual version constraint?
  7. Retention: is there any pruning/archival tooling, or do we own the growth problem?

Integration Approach

Stack fit

  • Fits cleanly into a conventional Laravel monolith or modular monolith (PHP 8.x, MySQL/Postgres, queue via Redis/SQS). No new infrastructure is required if writes are synchronous; a queue worker is required if not, which we likely already run.
  • It is a poor fit for architectures that deliberately bypass Eloquent (repository layers issuing bulk queries), multi-database/sharded write paths, or event-sourced designs where the domain already produces an authoritative event log — in those cases we would be building a second, weaker log alongside the first.

Migration path

  • Greenfield: adopt early, before models proliferate, so the trait/config is baked in from the start.
  • Brownfield: no data migration is needed for the package itself, but historical change data prior to adoption does not exist and cannot be backfilled. That is a one-way door — if a customer contract requires "full history since account creation," adoption timing matters commercially.
  • We should treat the package's schema as our schema from day one: own the migration file in our repo, add our own indexes and actor/correlation columns, and never rely on the vendor migration being re-published.

Compatibility

  • Verify against our pinned Laravel and PHP versions with a real install in a throwaway branch before committing. Check Composer constraints resolve against our lockfile without forcing unrelated upgrades — a transitive bump of Laravel or a dev dependency is a common hidden cost of small packages.
  • Confirm DB support for our engine(s), and confirm behavior under our tenancy model if we use a shared-schema multi-tenant database (history rows must carry tenant_id, or queries will leak across tenants).

Sequencing

  1. Spike (1–2 days): install in a scratch branch, instrument two representative models (one with casts/JSON, one with soft deletes), verify capture of create/update/delete/restore, quiet-save behavior, and bulk-update behavior. Exit criterion: a written, evidence-backed behavior matrix.
  2. Design decision (with compliance/security): attribute allowlist vs denylist, PII redaction rules, retention window, read-access model, actor attribution source.
  3. Adapter layer (2–3 days): wrap behind an internal service/interface so domain code calls our API, not the vendor's. This is the single highest-leverage risk mitigation and costs little.
  4. Pilot (1 sprint): enable on a bounded domain (e.g., billing settings, user roles) where the audit value is highest and write volume is lowest.
  5. Rollout: expand model-by-model behind config; do not enable globally by default, since attribute-level capture on high-churn tables is where growth and noise problems appear.
  6. Operationalize: dashboards for table growth, retention job, runbook, and a documented "what is not captured" list for auditors.

Operational Impact

Maintenance

  • Low code footprint, but ownership risk is real. Plan for the realistic outcome that we become the de facto maintainer: fork, vendor, or reimplement a ~300-line observer if the upstream stops tracking Laravel releases. Because we are wrapping it behind an adapter, that swap is bounded, not a rewrite.
  • Ongoing cost is mostly schema and retention: a scheduled pruning job, index maintenance, and periodic review of the tracked-attribute list as models evolve. Attribute lists drift silently — new sensitive columns appear and get captured by a denylist config. Prefer an allowlist.

Support

  • No vendor support; internal enablement only. That is acceptable for an internal audit capability but must be explicit: no SLA, no CVE process. Track it in the dependency inventory and include it in upgrade reviews alongside framework bumps.
  • Audit consumers (support staff, compliance, customer-facing history views) will generate questions the package does not answer — "why isn't this change here?" is the recurring one. The "known gaps" document is a support artifact, not just engineering documentation.

Scaling

  • Write amplification is the primary scaling concern: an update touching 8 attributes produces 8 rows. On a table with millions of writes/day this both doubles write volume and inflates the history table well beyond the source table. Mitigations: restrict to meaningful attributes, exclude high-churn/low-value columns (counters, last_seen_at, derived fields), consider async writes, and partition or archive by month if volume warrants.
  • Read scaling is generally fine with proper composite indexes on (model_type, model_id, created_at) plus tenant_id. Without those, the history view will degrade as the table grows — a predictable, avoidable problem if we own the migration.
  • Actor attribution requires request context; in queue workers that context is absent. Decide up front how jobs are attributed (system actor + job metadata), or the log will be misleading exactly where automated changes matter most.

Failure modes

  • Silent incompleteness (bulk updates, raw SQL, quiet saves) — highest severity, because it undermines the entire premise and is invisible to users. Mitigate with code-review conventions, static analysis/linting against direct query-builder writes on audited tables, and the documented gaps list.
  • Audit write fails inside the domain transaction → business operation rolls back. Decide explicitly: fail-open (lose audit, keep business) or fail-closed (keep audit, break business). Most SaaS products choose fail-open with alerting; regulated contexts may require fail-closed.
  • Recursion / self-referential observation if an observer or model boot hook itself saves a tracked model — guard rails and a test are needed.
  • Unbounded growth → disk pressure and slow queries, typically discovered late. Needs an alert on table size from day one.
  • PII leakage into the history table → a data-residency/GDPR exposure that is harder to remediate than the source table because history is append-only and often retained longer. Redaction must be designed, not discovered.
  • Upstream abandonment mid-upgrade cycle → blocked Laravel upgrade. Mitigated by the adapter boundary and a fork contingency.

Ramp-up

  • Engineering: roughly half a day for a Laravel-fluent engineer to be productive; the API surface is small and idiomatic.
  • Organization: 1–2 weeks to get compliance/security sign-off on scope, redaction, retention, and reader access — this, not code, is the critical path.
  • Total realistic first-value estimate for a single domain: 2–3 weeks elapsed, 5–7 engineer-days. Full rollout across core models: 1–2 sprints depending on how many models need attribute curation.
  • Recommendation: proceed as a pilot, not a platform commitment, gated on the spike's behavior matrix. The package is small, permissively licensed, and conceptually well matched to Laravel — but at 19 stars it is unproven, and the correct posture is to buy the concept, wrap it in our own abstraction, and retain an inexpensive exit.
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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource