LaravelPackages.net
Acme Inc.
Toggle sidebar
boing6002/versioning

Prevents update conflicts using the optimistic lock pattern in Laravel

5
0
1.1.10
About boing6002/versioning

boing6002/versioning is a Laravel package for prevents update conflicts using the optimistic lock pattern in laravel. It currently has 0 GitHub stars and 5 downloads on Packagist (latest version 1.1.10). Install it with composer require boing6002/versioning. Discover more Laravel packages by boing6002 or browse all Laravel packages to compare alternatives.

Last updated

Versioning

Codacy Badge StyleCI License Total Downloads Latest Stable Version

Prevents update conflicts using the optimistic lock pattern in Laravel

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

Configuration & Usage

Be sure to check out the full Enso documentation at docs.laravel-enso.com

Contributions

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

License

This package is released under the MIT license.

Star History Chart