Download the PHP package sthira-labs/version-vault without Composer

On this page you can find all versions of the php package sthira-labs/version-vault. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package version-vault

VersionVault (sthira-labs/version-vault)

VersionVault is a Laravel package for model versioning that is diff-first, snapshot-assisted, and relation-aware. It captures minimal diffs, supports nested relations (including pivot data), and can reconstruct or rollback historical state.

Features

Requirements

Installation

Publish & Migrate

Publish the config and migrations, then run migrations:

To publish only the config:

To publish only the migrations:

Quick Start

Reconstruction Basics

Reconstruction is non-destructive by default: existing loaded relations on the template model are preserved, and only attributes present in the snapshot are applied. Relations not present in the snapshot remain untouched unless you enable attach_unloaded_relations or force_replace_relation.

reconstructVersion() always returns a ReconstructionResult DTO with:

When with_diff_paths is enabled, many-relation operations include id-scoped paths:

Relation Tracking Modes

Each relation can be tracked in one of two modes:

Implicit rule (Option B):

To force snapshot explicitly, add mode: snapshot to the relation config.

Example: Reference Mode (FK-only)

Example: Snapshot Mode (full relation)

Reference Relations in Reconstruction

Reference relations are not hydrated from the snapshot. The foreign key is stored as a normal attribute, so you can eager load after reconstruction:

If you want FK-only tracking without listing the relation, you can track the FK attribute directly:

Snapshot Relations in Reconstruction

Snapshot relations are hydrated from stored data (or explicitly allowed via reconstruct_relations):

Configuration

Config file: config/version-vault.php

Migration Note

Default relation tracking is now reference mode to avoid creating versions when related model attributes change but the foreign key does not. If you rely on deep relation snapshots, configure the relation with fields (implicit snapshot) or set mode: snapshot.

Version Records (created_by)

If an authenticated user exists, created_by is recorded on each version. You can also pass an explicit user id as the third argument to recordVersion, recordVersionIfChanged, or forceSnapshot — useful from queue jobs or system actors where Auth::id() is not available.

The Version model exposes a createdBy() relation that resolves via version-vault.user_model or falls back to auth.providers.users.model.

Snapshot & Diff Format

See docs/NEW_NODE_FORMAT.md for the exact snapshot/diff schema and examples.

Events

VersionVault dispatches lifecycle events you can listen to:

Details and payloads are documented in docs/EVENTS.md.

Testing

Useful Commands

Development

Local dev option: use the provided docker-compose / Makefile or Laravel Sail.

License

MIT


All versions of version-vault with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sthira-labs/version-vault contains the following files

Loading the files please wait ...