PHPackages                             boing6002/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. [Database &amp; ORM](/categories/database)
4. /
5. boing6002/versioning

ActiveLibrary[Database &amp; ORM](/categories/database)

boing6002/versioning
====================

Prevents update conflicts using the optimistic lock pattern in Laravel

1.1.10(7y ago)05MITPHP

Since May 25Pushed 7y agoCompare

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

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

Versioning
==========

[](#versioning)

[![Codacy Badge](https://camo.githubusercontent.com/77b8dc8dda512c6f333fa6cfad668c08ec19b3b46fe77f09ff111008865ec749/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6666343135626236353932373437396138306431373336323264336331316564)](https://www.codacy.com/app/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

### Details

[](#details)

- 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 deleted only on model `forceDelete`
- throws a `ConflictHttpException` if the version is incorrect
- tests are included with the package
- package comes included by default with [Enso](https://github.com/laravel-enso/Enso)

### Configuration &amp; Usage

[](#configuration--usage)

Be sure to check out the full Enso documentation at [docs.laravel-enso.com](https://docs.laravel-enso.com)

### 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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 53.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 ~12 days

Total

15

Last Release

2731d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/717752e2ec25cf847df470853b6a7e1226cb0e62dbd3b201dcbf30d9741fe602?d=identicon)[boing6002](/maintainers/boing6002)

---

Top Contributors

[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (7 commits)")[![shirshak55](https://avatars.githubusercontent.com/u/8097377?v=4)](https://github.com/shirshak55 "shirshak55 (3 commits)")[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (1 commits)")[![boing6002](https://avatars.githubusercontent.com/u/45848144?v=4)](https://github.com/boing6002 "boing6002 (1 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (1 commits)")

---

Tags

traitversioningoptimistic-locklaravel-enso

### Embed Badge

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

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

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[cybercog/laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

1.1k651.8k11](/packages/cybercog-laravel-ban)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[laravel-enso/versioning

Prevents update conflicts using the optimistic lock pattern in Laravel

3616.8k1](/packages/laravel-enso-versioning)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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