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

Historytracker Laravel Package

laravel-enso/historytracker

HistoryTracker for Laravel Enso automatically records model changes, storing a versioned audit trail of created, updated, and deleted records with the user and timestamp behind each change, so you can review and roll back history from the Enso UI.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • laravel-enso/historytracker is an Eloquent-level audit package from the Laravel Enso admin-suite ecosystem. Integration model is a trait applied to models plus a polymorphic history table, with model events (create/update/delete) driving row writes.
  • It is designed to run inside Enso, not standalone. Expect composer-time coupling to Enso core/helper packages (laravel-enso/core, laravel-enso/helpers, and by implication Enso's users/people conventions for the created_by / updated_by attribution columns). Confirm the exact dependency graph from composer.json before assuming an isolated install.
  • Record shape is snapshot-plus-attribution rather than an append-only event log: a history row per model mutation, keyed to historable_type / historable_id. This is convenient for "show me this record's timeline" UI, but it is not a tamper-evident audit ledger.

Integration feasibility

  • Trivial in an existing Enso application: composer require, publish/run migrations, add the trait, toggle tracked events in the package config. Hours, not days.
  • Outside Enso, feasibility drops sharply. The package's migrations and attribution columns assume Enso's user model and table naming; retrofitting means editing migrations and overriding config — effectively a fork.
  • The repository is archived. That is the dominant constraint: no upstream fixes, no Laravel/PHP version bumps, no security response. Anything beyond the pinned version matrix becomes internal maintenance.

Technical risk

  • Version risk (high): archival implies the last supported Laravel/PHP range is frozen in time. Modern Laravel (10/11/12) and PHP 8.2+ will likely require constraint relaxation and code review of typed properties, facades, and event signatures.
  • Capture-completeness risk (high): model-event-based tracking silently misses Model::query()->update(), insert(), raw SQL, and queue/console contexts where auth attribution is absent. Any audit or compliance use case must be validated against these gaps.
  • Data governance risk (medium-high): history rows will duplicate PII from the source models. Retention, right-to-erasure, and access control on the history table become your problem, and the package does not ship retention tooling.
  • Ecosystem risk (medium): 51 stars and a single-maintainer lineage mean effectively zero community backstop. Bus factor is internal, not external.
  • Scoring signal: an aggregate score of ~0.33 reflects low adoption and activity; treat it as "viable code, unmaintained project."

Key questions

  1. Which Laravel and PHP versions does the pinned release actually declare, and does it install cleanly on our target runtime?
  2. Does it require the full Enso stack (auth, companies/people, structure manager), or can attribution columns be satisfied with our own user model?
  3. Does the schema store full snapshots, dirty-attribute diffs, or both — and is the history table writable/editable through any UI (i.e., is it tamper-evident)?
  4. Are history writes synchronous inside the same transaction as the model write? If yes, a history failure can roll back or break a business write.
  5. What are the delete semantics — soft deletes, hard deletes, cascading deletes, and does history survive them?
  6. Is there any retention/pruning mechanism, or is growth unbounded by design?
  7. What is the license/attribution obligation for a fork (MIT — permissive, so forking is legally clean)?

Integration Approach

Stack fit

  • Green-field or existing Enso app: strong fit. It is the native audit mechanism for that stack; adopting anything else means fighting Enso's UI conventions for history panels.
  • Laravel without Enso: poor fit. The cost of decoupling (migrations, user model bindings, config overrides, fork maintenance) exceeds the cost of adopting a maintained alternative such as spatie/laravel-activitylog or owen-it/laravel-auditing, both of which have broader version support and active maintenance.
  • Non-Laravel / polyglot services: no fit. Audit must then be solved above the framework (CDC, event sourcing, DB triggers) rather than per-model.

Migration path

  • Preferred: vendor the package as an internal fork (acme/historytracker) under our namespace, bump composer.json constraints, patch deprecations, and add it to our own release cadence. MIT makes this clean.
  • Alternative: install as-is on a legacy pinned runtime where it already works, and accept it as frozen — only defensible if that runtime is itself scheduled for retirement.
  • If replacing rather than adopting, the migration is schema-compatible in shape (polymorphic history + attribution) but not column-compatible; plan a data-mapping script and a dual-write window if historical continuity matters.

Compatibility

  • Audit the trait for $guarded/$fillable interactions, JSON/array casts, and date/timezone handling — these are the usual breakage points across Laravel majors.
  • Confirm the created_by FK behavior under our auth guard, including API-token and service-account requests, and add an explicit system-user fallback.
  • Test polymorphic type resolution if models live in different namespaces than Enso's defaults (morph maps).

Sequencing

  1. Spike (1–2 days): install in a scratch branch, run migrations, attach the trait to one low-risk model, and confirm capture of create/update/delete plus the known blind spots (bulk update, console).
  2. Runtime validation: install on the actual target PHP/Laravel versions; log every composer conflict and required patch.
  3. Fork decision gate: if more than a day of patching is needed, fork and own it; do not proceed on the archived upstream.
  4. Pilot: one bounded domain (e.g., a settings or catalog model), with the history UI/query path exercised end to end.
  5. Governance design: retention window, access control on the history table, erasure procedure, and PII scoping — before broad rollout.
  6. Rollout: model by model, with an explicit exclusion list for high-volume or low-value models.

Operational Impact

Maintenance

  • Effectively internal ownership from day one. The archive status means every future Laravel/PHP upgrade is our ticket. Budget a small but recurring allowance — the codebase is small, so this is measured in hours per upgrade cycle, not weeks.
  • Keep the fork patch surface minimal (constraint bumps + deprecation fixes) so rebasing or abandoning later stays cheap.
  • Track upstream: if the Enso maintainers unarchive or a successor package appears, we want a documented exit ramp.

Support

  • No vendor support, no issue triage, no security advisories. Internal runbook required: how to inspect history rows, how to backfill a missing window, how to disable tracking per model in an incident.
  • Onboarding documentation should state plainly that this is a frozen third-party component under internal stewardship — otherwise a future engineer will assume it is supported.

Scaling

  • Write amplification: one history row per tracked mutation; on write-heavy tables this is a meaningful throughput and storage multiplier. Measure insert latency on the pilot before tracking high-churn models.
  • The history table grows monotonically. Without pruning/partitioning it will outgrow its source tables. Plan a retention policy (e.g., 12–24 months) and consider time-based partitioning or archival to cold storage.
  • Read path: history UI queries filter by historable_type + historable_id and sort by time — ensure a composite index exists, or detail screens will degrade as the table grows.
  • Avoid tracking derived/cache-like models; scope tracking to entities with genuine audit or dispute-resolution value.

Failure modes

  • Silent gaps: bulk updates, raw SQL, and queue workers bypass model events — history claims completeness it does not have. Do not present it as compliance-grade.
  • Write coupling: synchronous history inserts inside the model transaction can fail or slow the primary write. Check whether tracking can be queued, or isolate failure handling so audit problems never break business operations.
  • Missing actor: jobs, seeders, and CLI commands produce rows with null or wrong created_by, corrupting attribution and any downstream "who changed this" reporting.
  • Schema drift: a source-model migration that renames or drops columns leaves historical snapshots unreadable or misrendered — the history UI assumes the current schema.
  • Tamper/erasure conflict: history rows are ordinary DB rows; they can be edited or deleted. If the use case requires immutability, add append-only enforcement (revoked UPDATE/DELETE grants, or an out-of-band audit sink).
  • Abandonment drift: the largest operational failure is simply staying on an ever-older framework branch to keep the package working.

Ramp-up

  • Developer ramp-up is short: it is a trait plus a config file, and any Laravel engineer is productive in under a day. The conceptual model (polymorphic history, attribution columns) is standard.
  • The real ramp-up is organizational: Enso conventions, the fork's release process, the retention/erasure runbook, and the exclusion list. Budget that as the actual onboarding cost.
  • TPM recommendation: adopt only if the application is already committed to Laravel Enso and the use case is in-app "what changed on this record" visibility. For standalone Laravel, compliance-grade audit, or any long-lived system, select a maintained alternative and treat this package as a reference implementation rather than a dependency.
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