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

Model History Laravel Package

audunru/model-history

A Laravel package that keeps a history of changes to your Eloquent models. Automatically records creates, updates, and deletes so you can see who changed what and when, browse past versions, and build audit trails with a simple, lightweight API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. audunru/model-history is a lightweight Eloquent audit-trail package: models opt in via a trait and history rows are written on model events. It fits applications that need change history without adopting a full event-sourcing or CDC pipeline. The v4.1.4 fix — persisting the morph alias of the owner rather than the fully qualified class name — is directly relevant to any codebase using Relation::morphMap(). That pattern is common in modular Laravel applications, so the fix improves correctness for a realistic segment of adopters rather than addressing an edge case.

Integration feasibility. Low. Integration is typically composer require, publishing config/migrations, running migrations, and adding a trait to selected models. The main integration decision is scoping which models warrant history, since every additional model increases write volume and storage.

Technical risk. Patch-level release; intrinsic upgrade risk is low. The material risk is semantic: consumers that read owner_type from history rows (admin UIs, exports, reporting jobs, tests) may previously have seen FQCNs and will now see morph aliases. Where morph maps were already enforced app-wide, the change aligns history with the rest of the schema; where maps were partial or absent, older and newer rows can diverge in format.

Key questions.

  • Does the application use morph maps, and are keys stable across environments?
  • Who consumes owner_type in history (UI, exports, downstream jobs), and are those readers alias-aware?
  • Is there existing history data that needs normalization/backfill?
  • What Laravel/PHP versions and database engines are supported by this release line?
  • What is the maintainer/bus-factor and test-coverage posture? The evidence base here is a single patch note, so deeper due diligence (changelog review, issue tracker, test suite) is warranted before adoption.

Integration Approach

Stack fit. Standard Composer-installed Laravel package; no infrastructure additions. Fits a conventional Laravel monolith or modular monolith. It does not replace a dedicated audit/compliance platform, so treat scope accordingly.

Migration path. Upgrade with composer update audunru/model-history (pin to ^4.1.4). Run any newly published migrations. If morph maps are in use, audit existing history rows and decide whether to backfill FQCNs to aliases via a one-off data migration; if morph maps are not in use, no data action is required.

Compatibility. Ensure morph map registration happens consistently at bootstrap (e.g., Relation::enforceMorphMap(...) in a service provider) so writes and reads agree. Validate against the app's supported Laravel/PHP matrix before promotion; do not assume parity with prior major versions from a patch note alone.

Sequencing.

  1. Pin the new patch in a branch and run the full test suite.
  2. Exercise a morph-map-enabled model end to end: create/update/delete, then verify history rows and all read paths resolve the owner correctly.
  3. If backfill is needed, rehearse the data migration on a production-like snapshot.
  4. Stage, then production, with a rollback path (previous pinned version) if owner resolution regresses.

Operational Impact

Maintenance. Low ongoing effort; history tables are append-only and the package surface is small. The active patch cadence is a positive maintenance signal, but teams should track releases rather than assume silence means stability.

Support. Open-source, community-supported; no vendor SLA. TPM should confirm internal ownership for upgrade testing and for the morph-alias data question, since that is application-specific rather than package-specific.

Scaling. The dominant cost is table growth, not package overhead. Every audited write adds a row, so define retention/pruning and index (owner_type, owner_id) and timestamp columns early. High-write models should be deliberately included or excluded.

Failure modes.

  • Alias mismatch: history rows reference an alias no longer registered, or a consumer expects an FQCN — owner resolution fails silently in UI/reporting.
  • Mixed-format data: pre- and post-upgrade rows differ if morph maps were introduced partway.
  • Unbounded growth: history table bloat degrading write latency and backup windows.
  • Scoping drift: blanket trait adoption causing write amplification.

Ramp-up. Minimal for Laravel developers — hours, not weeks. The real onboarding need is conceptual: teams must understand morph maps and audit-data retention, because that is where the v4.1.4 change has operational consequences. Plan a short internal note documenting alias conventions and history read paths alongside the upgrade.

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.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
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