PHP code example of mohamedhekal / lockguard
1. Go to this page and download the library: Download mohamedhekal/lockguard library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mohamedhekal / lockguard example snippets
use Hekal\LockGuard\Facades\LockGuard;
LockGuard::with('inventory:sku-1', function () {
// exclusive critical section
});
Route::middleware('lockguard:checkout:session,15')->post('/checkout', ...);
public function middleware(): array
{
return [new \Hekal\LockGuard\Support\WithoutOverlapping('sync:tenant-1')];
}