Weave Code
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

Laravel Versionable Laravel Package

overtrue/laravel-versionable

Add lightweight version history to Laravel Eloquent models. Track only changed attributes, control fields via whitelist/blacklist, keep a set number of versions, browse versions and revert to any saved point in time with simple APIs and migrations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Auditability & Compliance: Enable versioning for critical models (e.g., user profiles, financial records, legal documents) to meet regulatory requirements (GDPR, SOX, HIPAA) or internal audit policies.
  • Undo/Redo Functionality: Add rollback capabilities for user-generated content (e.g., CMS posts, product listings, or configuration settings) where accidental edits must be reversible.
  • Feature Roadmap:
    • Phase 1: Implement versioning for high-risk models (e.g., User, Order, Contract) to support compliance audits.
    • Phase 2: Integrate with admin panels (e.g., Filament, Nova) via mansoorkhan96/filament-versionable for UI-driven version management.
    • Phase 3: Extend to support collaborative editing (e.g., "Who changed this and when?" for team workflows).
  • Build vs. Buy:
    • Buy: Avoid reinventing versioning logic (e.g., custom triggers, diff algorithms, or storage strategies). This package handles edge cases (e.g., soft deletes, diff formatting) and integrates seamlessly with Laravel’s ecosystem.
    • Build: Only if versioning requires domain-specific logic (e.g., custom validation per version or non-standard storage like S3). Otherwise, this package reduces technical debt.
  • Use Cases:
    • Content Management: Track edits to blog posts, marketing pages, or documentation (e.g., "Revert to v3 after the client approved it").
    • E-Commerce: Audit order modifications (e.g., "Customer changed shipping address from X to Y at 2024-05-20T14:30").
    • HR/Finance: Version-sensitive data like employee records or invoices to comply with change-tracking policies.
    • DevOps: Store configuration versions (e.g., Kubernetes manifests, CI/CD pipelines) with diffs for rollback.

When to Consider This Package

  • Adopt if:
    • Your Laravel app requires immutable history for critical data (e.g., financial, legal, or user-generated content).
    • You need lightweight versioning without heavyweight tools like Git (e.g., for internal admin panels).
    • Your team prioritizes developer velocity: This package reduces boilerplate for versioning logic, diffs, and rollbacks.
    • You’re using Laravel 9+ and PHP 8.1+ (or plan to upgrade soon).
    • You want flexibility to customize version storage (e.g., snapshot vs. diff strategy) or integrate with UI frameworks (e.g., Filament).
  • Look elsewhere if:
    • You need fine-grained access control per version (e.g., "Only admins can revert X"). This package lacks built-in RBAC; pair with Laravel Policies or Gates.
    • Your versioning requires offline support or real-time collaboration (e.g., Google Docs-style). Consider a dedicated tool like ActivityPub or Operational Transformation.
    • You’re using non-Laravel backends (e.g., Django, Rails). Porting this package may not be worth the effort.
    • Your data is extremely large (e.g., terabytes of binary blobs). This package stores versions in a relational database; consider object storage (S3) or time-series databases for scalability.
    • You need versioning for relationships (e.g., tracking changes to hasMany or belongsTo models). This package versions attributes only; extend with custom logic or use a package like spatie/laravel-activitylog for related models.
    • Your compliance needs tamper-proof logs (e.g., blockchain-based auditing). This package relies on SQL integrity; pair with Laravel’s signing or a dedicated audit trail.

How to Pitch It (Stakeholders)

For Executives: "This package lets us add version history to critical data—like user profiles, orders, or legal documents—with minimal engineering effort. Think of it as 'undo' and 'audit logs' for our app. For example, if a customer disputes a charge, we can instantly see who changed their shipping address and when, reducing fraud risk. It also helps us comply with regulations like GDPR by tracking data changes automatically. The cost? Almost zero—it’s a lightweight Laravel package that integrates in hours, not weeks. We can start with high-risk models and expand as needed."

For Engineers: *"This solves versioning pain points out of the box:

  • Automatic versioning: Just add a trait to your model, and every save()/update() creates a version.
  • Flexible storage: Choose between diffs (only changed fields) or snapshots (full copies) to balance storage and performance.
  • Rollback support: Revert to any version with $model->revertToVersion(3) or fetch diffs for UI previews.
  • Laravel-native: Works with Eloquent, migrations, and even Filament admin panels via a dedicated plugin.
  • Low maintenance: MIT-licensed, actively updated (last release: 2026), and used by 587+ projects.

Trade-offs:

  • Not a full-fledged Git-like system (no branching/merging).
  • Requires database storage (not ideal for massive binary data).
  • Customize further if you need per-version permissions or non-standard storage.

Proposal:

  1. Pilot: Enable versioning for User and Order models to test compliance/audit use cases.
  2. Integrate: Add Filament support for UI-driven version management.
  3. Scale: Extend to other high-risk models as needed.

Alternatives considered:

  • Custom solution: Would take 2–4 weeks to build and maintain.
  • Off-the-shelf tools: Overkill for our needs (e.g., Git-based systems add complexity). This package gives us 80% of the value with 20% of the effort."*
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor