PHPackages                             rs/laravel-version-control - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rs/laravel-version-control

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rs/laravel-version-control
==========================

Foundations for making your app version controlled. Provides migration, blueprint and base models. Will make your app GxP compliant if you exclusively use the VC models and table structure as set out in this package.

v1.1.0(2y ago)1227.5k3[2 issues](https://github.com/RedSnapper/laravel-version-control/issues)PHPPHP ^8.0CI failing

Since Aug 12Pushed 2y ago3 watchersCompare

[ Source](https://github.com/RedSnapper/laravel-version-control)[ Packagist](https://packagist.org/packages/rs/laravel-version-control)[ RSS](/packages/rs-laravel-version-control/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (6)Used By (0)

Laravel Version Control
=======================

[](#laravel-version-control)

This package provides base models to use to make your app Version Control. It will also meet GxP compliance requirements.

Installation
------------

[](#installation)

```
composer require rs/laravel-version-control
```

If you wish to adjust the installation you can publish the assets

`php artisan vendor:publish` to see publishing options, choose the appropriate option to publish this packages assets.

Migrations
----------

[](#migrations)

You should setup your migrations to follow the migrations as seen in the tests/Fixtures/database/migrations files. For each model 2 tables will be created, the key (normal) table and the version history table.

Example migration

```
use Redsnapper\LaravelVersionControl\Database\Blueprint;
use Redsnapper\LaravelVersionControl\Database\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        $this->makeVcTables("users",function(Blueprint $table){
            $table->string('email')->unique();
            $table->string('password');
        },function(Blueprint $table){
            $table->string('email');
            $table->string('password');
        });
    }
}
```

Note we are using are own custom Migration and Blueprint class. This will create 2 tables: The users table and a corresponding users\_versions table. The 3rd parameter is optional and will fallback to the fields in the second parameter.

### Version Control Models

[](#version-control-models)

Each model you create should extend the Redsnapper\\LaravelVersionControl\\Models\\BaseModel

```
use Redsnapper\LaravelVersionControl\Models\BaseModel;

class Post extends BaseModel
{
}
```

### 'Pivot' tables

[](#pivot-tables)

Pivot table records are never destroyed. On creation they persist as records for the lifecycle of the project. Instead whenever a record is detached an active flag is switched to false.

### Versions relationship

[](#versions-relationship)

Versions can be accessed from models using the versions relationship.

```
$model->versions();
```

### Anonymize

[](#anonymize)

To anonymize any field for any model pass an array of the fields to be anonymized as below.

```
$model->anonymize(['email'=>'anon@example.com']);
```

This will create a new version for the action and will anonymize the fields passed. This will anonymize all versions attached to this model.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 54.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~668 days

Total

3

Last Release

762d ago

PHP version history (3 changes)v1.0.0PHP ^7.1.3

v1.0.1PHP ^7.3|^8.0

v1.1.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1785064?v=4)[Mr Ben Griffin](/maintainers/MrBenGriffin)[@MrBenGriffin](https://github.com/MrBenGriffin)

![](https://avatars.githubusercontent.com/u/6851104?v=4)[rstechnical](/maintainers/rstechnical)[@rstechnical](https://github.com/rstechnical)

---

Top Contributors

[![paramdhal](https://avatars.githubusercontent.com/u/1278858?v=4)](https://github.com/paramdhal "paramdhal (37 commits)")[![mmltonge](https://avatars.githubusercontent.com/u/45395163?v=4)](https://github.com/mmltonge "mmltonge (25 commits)")[![cammackmatthew](https://avatars.githubusercontent.com/u/10643740?v=4)](https://github.com/cammackmatthew "cammackmatthew (3 commits)")[![anaxamaxan](https://avatars.githubusercontent.com/u/439457?v=4)](https://github.com/anaxamaxan "anaxamaxan (1 commits)")[![mnaderian](https://avatars.githubusercontent.com/u/30769988?v=4)](https://github.com/mnaderian "mnaderian (1 commits)")[![MrBenGriffin](https://avatars.githubusercontent.com/u/1785064?v=4)](https://github.com/MrBenGriffin "MrBenGriffin (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rs-laravel-version-control/health.svg)

```
[![Health](https://phpackages.com/badges/rs-laravel-version-control/health.svg)](https://phpackages.com/packages/rs-laravel-version-control)
```

###  Alternatives

[lukasbesch/bedrock-plugin-disabler

Disable certain plugins in non-production environments using PHP constants.

5585.7k](/packages/lukasbesch-bedrock-plugin-disabler)[lara-zeus/inline-chart

Zeus Inline Chart easily add a chart in filamentPHP table column

2139.9k](/packages/lara-zeus-inline-chart)[pdir/social-feed-bundle

Social feed extension for Contao CMS

1414.8k](/packages/pdir-social-feed-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
