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

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

reshadman/laravel-optimistic-locking
====================================

Adds optimistic locking feature to eloquent models.

1.1.0(7y ago)9618.4k↓33.3%25[6 issues](https://github.com/reshadman/laravel-optimistic-locking/issues)[1 PRs](https://github.com/reshadman/laravel-optimistic-locking/pulls)MITPHPPHP ^7.1CI failing

Since Jun 3Pushed 6y ago3 watchersCompare

[ Source](https://github.com/reshadman/laravel-optimistic-locking)[ Packagist](https://packagist.org/packages/reshadman/laravel-optimistic-locking)[ RSS](/packages/reshadman-laravel-optimistic-locking/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (12)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 reshadman/laravel-optimistic-locking
```

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

Usage
-----

[](#usage)

### Basic usage

[](#basic-usage)

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

```
