A lock manager for Laravel 5.
Either PHP 5.5+ or HHVM 3.6+ are required.
To get the latest version of Alt Three Locker, simply require the project using Composer:
$ composer require alt-three/lockerInstead, you may of course manually update your require block and run composer update if you so choose:
{
"require": {
"alt-three/locker": "^1.0"
}
}Once Alt Three Locker is installed, you need to register the service provider. Open up config/app.php and add the following to the providers key.
'AltThree\Locker\LockerServiceProvider'
You can register the Locker facade in the aliases key of your config/app.php file if you like.
'Locker' => 'AltThree\Locker\Facades\Locker'
Alt Three Locker requires configuration.
To get started, you'll need to publish all vendor assets:
$ php artisan vendor:publishThis will create a config/locker.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.
Alt Three Locker provides a locker class which should be used to execute critical tasks while acquiring a lock to do so. We also have a locker middleware which will acquire a lock on a per session basis to perform "unsafe" tasks, or in other words, we're preventing more than one non-GET request from being processed at once per user.
If you discover a security vulnerability within this package, please e-mail us at support@alt-three.com. All security vulnerabilities will be promptly addressed.
Alt Three Locker is licensed under The MIT License (MIT).