PHPackages                             laravel-enso/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. laravel-enso/versioning

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

laravel-enso/versioning
=======================

Prevents update conflicts using the optimistic lock pattern in Laravel

2.0.4(3y ago)3616.8k8[1 issues](https://github.com/laravel-enso/versioning/issues)2MITPHPPHP &gt;=8.0CI failing

Since May 25Pushed 3y ago5 watchersCompare

[ Source](https://github.com/laravel-enso/versioning)[ Packagist](https://packagist.org/packages/laravel-enso/versioning)[ Docs](https://github.com/laravel-enso/versioning)[ RSS](/packages/laravel-enso-versioning/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (40)Used By (2)

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

42

—

FairBetter than 90% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~47 days

Recently: every ~249 days

Total

38

Last Release

1142d 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/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (15 commits)")[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (9 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)")[![npw1982](https://avatars.githubusercontent.com/u/47890938?v=4)](https://github.com/npw1982 "npw1982 (2 commits)")[![CasperLaiTW](https://avatars.githubusercontent.com/u/5094008?v=4)](https://github.com/CasperLaiTW "CasperLaiTW (1 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (1 commits)")

---

Tags

laravellaravel-ensooptimistic-lockingoptimistic-updatestraitversioningtraitversioningoptimistic-locklaravel-enso

### Embed Badge

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

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

###  Alternatives

[pragmarx/version

Take control over your Laravel app version

5921.2M2](/packages/pragmarx-version)[laravel-enso/history-tracker

Model history tracking dependency for Laravel Enso

5246.8k5](/packages/laravel-enso-history-tracker)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[laravel-enso/track-who

Create, update and delete authoring tracking dependency for Laravel Enso

2942.4k31](/packages/laravel-enso-track-who)[vildanbina/laravel-versions

A Laravel package for managing model drafts.

333.3k](/packages/vildanbina-laravel-versions)

PHPackages © 2026

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