PHPackages                             laravel-appkit/lockable - 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. laravel-appkit/lockable

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

laravel-appkit/lockable
=======================

v1.0.0(5y ago)212[5 PRs](https://github.com/laravel-appkit/lockable/pulls)MITPHPPHP ^7.3|^8.0

Since Jan 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/laravel-appkit/lockable)[ Packagist](https://packagist.org/packages/laravel-appkit/lockable)[ Docs](https://github.com/laravel-appkit/lockable)[ RSS](/packages/laravel-appkit-lockable/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (1)Dependencies (4)Versions (9)Used By (0)

Eloquent Lockable
=================

[](#eloquent-lockable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/665104f4f46ca5e78a37eed6bd0b6445464c13dafdff812bf25a033c94c1aaf0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6170706b69742f6c6f636b61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-appkit/lockable)[![Build Status](https://camo.githubusercontent.com/b3a05e835dc024067108d62f83fcb37befba04753ddebf8cccfc66578c9495af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c61726176656c2d6170706b69742f6c6f636b61626c652f4175746f6d6174656425323054657374733f7374796c653d666c61742d737175617265)](https://github.com/laravel-appkit/lockable/actions?query=workflow%3A%22Automated+Tests%22)[![Quality Score](https://camo.githubusercontent.com/be95cc0882561893c45e8990465b639cbe591a403ba31e0b8fb1e640bd5fc7be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c61726176656c2d6170706b69742f6c6f636b61626c652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307175616c697479267374796c653d666c61742d737175617265)](https://github.com/laravel-appkit/lockable/actions?query=workflow%3A%22Check+%26+fix+styling%22)[![Total Downloads](https://camo.githubusercontent.com/ebd123d73111a3ffe5ad291dbfd677d725af72787edb9d0405381c99efe8d7d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6170706b69742f6c6f636b61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-appkit/lockable)[![Licence](https://camo.githubusercontent.com/15869529ce07d54fbe1af3683ab434ee299004d0b37963c97d97e85700a278fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61726176656c2d6170706b69742f6c6f636b61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-appkit/lockable)

Allows a user to acquire a lock on a model, which prevents anyone else from being able to edit it.

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

[](#installation)

You can install the package via composer:

```
composer require laravel-appkit/lockable
```

Usage
-----

[](#usage)

Add the `AppKit\Lockable\Traits\Lockable` trait to the model you want to set locks on

Add a `locked_by` integer column to the corresponding table. This can also be done using the `lockable` method on the migration.

```
