PHPackages                             kerwin-cn/laravel-optimistic-locking - 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. kerwin-cn/laravel-optimistic-locking

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

kerwin-cn/laravel-optimistic-locking
====================================

Adds optimistic locking feature to eloquent models.

1.3.2(3y ago)012.8kMITPHPPHP ^7.1|^8.0

Since Jun 3Pushed 3y agoCompare

[ Source](https://github.com/kerwin-cn/laravel-optimistic-locking)[ Packagist](https://packagist.org/packages/kerwin-cn/laravel-optimistic-locking)[ RSS](/packages/kerwin-cn-laravel-optimistic-locking/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (5)Versions (16)Used By (0)

Laravel Optimistic Locking
==========================

[](#laravel-optimistic-locking)

[![Build Status](https://camo.githubusercontent.com/e7f16156c81076cb729040d7a2331e548d81de06721cb9b9cdf3e07710bc0d15/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f7265736861646d616e2f6c61726176656c2d6f7074696d69737469632d6c6f636b696e672f6d61737465722e706e673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/e7f16156c81076cb729040d7a2331e548d81de06721cb9b9cdf3e07710bc0d15/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f7265736861646d616e2f6c61726176656c2d6f7074696d69737469632d6c6f636b696e672f6d61737465722e706e673f7374796c653d666c61742d737175617265)

Adds optimistic locking feature to Eloquent models.

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

[](#installation)

```
composer require kerwin-cn/laravel-optimistic-locking
```

> This package supports Laravel 5.5.*, 5.6.*, 5.7.*, 5.8.*, 6.*, 7.* and 8.\*.

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

use the `\Reshadman\OptimisticLocking\OptimisticLocking` trait in your model:

```
