laravel-liberu/versioning 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravel-liberu/versioning

最新稳定版本:v2.0.10

Composer 安装命令:

composer require laravel-liberu/versioning

包简介

Prevents update conflicts using the optimistic lock pattern in Laravel

README 文档

README

Codacy Badge StyleCI License Total Downloads Latest Stable Version

Prevents update conflicts using the optimistic lock pattern in Laravel

This package can work independently of the Liberu ecosystem.

For live examples and demos, you may visit liberu.co.uk

Installation

  1. install the package composer require laravel-liberu/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

  • 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 & Usage

Be sure to check out the full documentation for this package available at docs.liberu.co.uk

Contributions

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

License

This package is released under the MIT license.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-19