PHPackages                             cgdsoftware/versioning - 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. [Framework](/categories/framework)
4. /
5. cgdsoftware/versioning

ActiveLibrary[Framework](/categories/framework)

cgdsoftware/versioning
======================

Prevents update conflicts using the optimistic lock pattern in Laravel

v2.0.4(3y ago)07MITPHPPHP &gt;=8.0

Since May 25Pushed 3y agoCompare

[ Source](https://github.com/cgdsoftware/versioning)[ Packagist](https://packagist.org/packages/cgdsoftware/versioning)[ Docs](https://github.com/cgdsoftware/versioning)[ RSS](/packages/cgdsoftware-versioning/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (41)Used By (0)

Versioning
==========

[](#versioning)

[![Codacy Badge](https://camo.githubusercontent.com/6e215e99f7f766f51dcb58429326d8f0b07d5f80c09970fb7529c0fe2259992a/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3164356235343261326430313461666561353461356263663331356530643963)](https://www.codacy.com/gh/laravel-enso/versioning?utm_source=github.com&utm_medium=referral&utm_content=laravel-enso/versioning&utm_campaign=Badge_Grade)[![StyleCI](https://camo.githubusercontent.com/21d7e3fd1d409fb709aad2e6b9f9b7aa1142bbe39d7d755f0e214221f06a803e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3133343836313933362f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/134861936)[![License](https://camo.githubusercontent.com/f250ee4fa5ac7c6797b1f480e87a941259687acd110e4881cc27324b5f23531d/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f76657273696f6e696e672f6c6963656e7365)](https://packagist.org/packages/laravel-enso/versioning)[![Total Downloads](https://camo.githubusercontent.com/db76f1411471a1198f2a5c6e3e78bd2380b6900bc2c6a27f6f834de6b431d5e5/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f76657273696f6e696e672f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/versioning)[![Latest Stable Version](https://camo.githubusercontent.com/b4885ae53328f309c5cc0f8609bbf2afcdd37b1ad6b55426632872f783484d07/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f76657273696f6e696e672f76657273696f6e)](https://packagist.org/packages/laravel-enso/versioning)

Prevents update conflicts using the optimistic lock pattern in Laravel

This package can work independently of the [Enso](https://github.com/laravel-enso/Enso) ecosystem.

For live examples and demos, you may visit [laravel-enso.com](https://www.laravel-enso.com)

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

[](#installation)

1. install the package `composer require laravel-enso/versioning`
2. run the migrations
3. use the `Versionable` trait on the models you want versioning on.

By default, the version value is kept in a 'version' attribute, but this can be customized (see below).

Features
--------

[](#features)

- the package creates a `versionings` table where it holds versions for all the versionable models
- by using the `Versionable` trait on a model, versioning is handled automatically
- by default the trait appends a `version` attribute after the model is retrieved, used for tracking versions and expects the same attribute to be present on the model when the update is called
- the default versioning attribute can be customized by using `protected $versioningAttribute = 'customVersionAttribte'` on the model
- the trait can be used on models that already have records in the database, the versioning starts with the first retrieval of those models
- when a versionable model is deleted, its versioning is deleted also. If the model uses `SoftDeletes`, the versioning is not deleted, unless doing a `forceDelete`
- throws a `ConflictHttpException` if the version does not match on update
- tests are included with the package

Configuration &amp; Usage
-------------------------

[](#configuration--usage)

Be sure to check out the full documentation for this package available at [docs.laravel-enso.com](https://docs.laravel-enso.com/backend/versioning.html)

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

License
-------

[](#license)

This package is released under the MIT license.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 60.8% 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 ~46 days

Recently: every ~235 days

Total

38

Last Release

1253d ago

Major Versions

1.4.3 → 2.0.02020-06-30

PHP version history (2 changes)1.4.0PHP &gt;=7.4.0

2.0.3PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/179251?v=4)[Curtis Delicata](/maintainers/curtisdelicata)[@curtisdelicata](https://github.com/curtisdelicata)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (45 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (15 commits)")[![raftx24](https://avatars.githubusercontent.com/u/10864136?v=4)](https://github.com/raftx24 "raftx24 (8 commits)")[![shirshak55](https://avatars.githubusercontent.com/u/8097377?v=4)](https://github.com/shirshak55 "shirshak55 (3 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (1 commits)")[![CasperLaiTW](https://avatars.githubusercontent.com/u/5094008?v=4)](https://github.com/CasperLaiTW "CasperLaiTW (1 commits)")[![curtisdelicata](https://avatars.githubusercontent.com/u/179251?v=4)](https://github.com/curtisdelicata "curtisdelicata (1 commits)")

---

Tags

traitversioningoptimistic-lockcgdsoftware

### Embed Badge

![Health badge](/badges/cgdsoftware-versioning/health.svg)

```
[![Health](https://phpackages.com/badges/cgdsoftware-versioning/health.svg)](https://phpackages.com/packages/cgdsoftware-versioning)
```

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M223](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[code16/sharp

Laravel Content Management Framework

79164.7k8](/packages/code16-sharp)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3891.8k](/packages/codewithdennis-larament)[r2luna/brain

Brain: A process-driven architecture alternative for your Laravel Application.

6338.7k1](/packages/r2luna-brain)

PHPackages © 2026

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