{"repo":"zaber-dev/laravel-lock","free":true,"listed":false,"github":"https://github.com/zaber-dev/laravel-lock","clone":"git clone https://github.com/zaber-dev/laravel-lock.git","description":"Application-level distributed locking for Laravel with Eloquent integration, middleware, automatic owner detection, and cache/database storage.","language":"PHP","stars":33,"topics":["concurrency","database","distributed-lock","eloquent","laravel","laravel-package","locking","mutex","race-conditions","redis"],"license":"MIT","category":"databases-storage","readme_excerpt":"Laravel Lock Supports: Laravel 11, 12 & 13+ • PHP 8.2+ • Redis • Memcached • Database Application-level distributed locking for Laravel. Prevent race conditions and concurrent execution across actions, workflows, and endpoints with automatic owner detection and cleanup. Manage locks using cache or persistent database storage, attach them to Eloquent models, protect routes with middleware, and automatically track ownership — all through a clean, expressive API. Unlike Laravel's low-level Cache::lock() , Laravel Lock elevates distributed locking into a first-class, entity-scoped application abstraction ( Lock::for(...) ) with owner detection and lifecycle events. --- Quick Example --- Common Use Cases Laravel Lock is ideal for: - Preventing duplicate payment processing - Serializing inventory allocation and order checkout pipelines - Protecting high-concurrency webhook processing endpoints - Ensuring single-instance background cron job execution - Preventing race conditions during financial account balance transfers - Coordinating distributed microservice operations - Preventing simultaneous document edits --- Why not Cache::lock()? Laravel's Cache::lock() is an excellent low-level primitive for atomic locking. Laravel Lock doesn't replace Cache::lock() . Instead, it builds on the same concept while providing higher-level application primitives for common Laravel workflows. Laravel Lock focuses on application-level locking with: - Automatic owner resolution ( user id , queue jo","default_branch":null,"files":null,"tree":[],"storefront":"/r/zaber-dev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zaber-dev/laravel-lock/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}