Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Locker Laravel Package

alt-three/locker

Alt Three Locker is a simple feature flag package for Laravel, letting you define toggles in config and check them anywhere in your app. Enable or disable features globally or per user without redeploying, keeping risky changes behind safe, manageable switches.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. Locker is a driver-based lock manager built in the Laravel idiom: a manager resolving pluggable drivers, a service provider, and a facade over the container. That makes it structurally easy to wire in. The problem is fit, not form — it implements a capability that has lived in the framework core since Laravel 5.6 (Illuminate\Cache\Lock, Cache::lock(), the LockProvider contract). On any Laravel ≥ 6 target, adopting Locker means maintaining a parallel implementation of a core primitive rather than filling a gap. Architectural duplication of a correctness-critical mechanism is a poor trade.

Integration feasibility. Composer-installable, MIT-licensed, small API surface, so the mechanical integration is trivial. The constraints are the issue: last release 2020-07-25, repo archived, so support almost certainly stops at PHP 7.x and Laravel 7/8. Expect composer require to resolve only inside a legacy constraint set, and treat any conflict as permanent — there is no "wait for a patch" option. Zero dependents on Packagist means effectively no field validation; we would be the only consumers, with no upstream issue history to lean on.

Technical risk. High, and concentrated in silence. Locking is a distributed-systems primitive where the failure is not a crash but a duplicate charge, a double-sent email, or a corrupted aggregate — bugs surface as data incidents, not exceptions. An unmaintained library gating that boundary is a standing liability. Compounding it, the "lock manager" abstraction can create false confidence: it presents uniform acquire/release semantics while the underlying driver (file, array) may be unsafe across multiple hosts. Secondary risk is ownership: no upstream to escalate to, so every defect becomes ours.

Key questions.

  • What semantics do we actually require: blocking vs try-lock, bounded lease/TTL, owner-token-verified release, reentrancy, fairness?
  • Single-host or multi-host execution? This alone determines whether file/database drivers are admissible.
  • What is our Laravel/PHP version floor and ceiling over the next 24 months?
  • Does Cache::lock() behind the LockProvider contract already cover ~90% of our call sites?
  • Is the intent to adopt, to fork, or to harvest the design as a reference for an internal abstraction?
  • If we fork, who owns it and what is its test budget?

Integration Approach

Stack fit. Viable only on a legacy Laravel (≈5.x–7.x) / PHP 7.x footprint. Run composer why-not alt-three/locker against each candidate app before any design work — that single command gates the entire decision. If the target is Laravel 8+, stop: the package is not the vehicle.

Migration path. Two directions, and the recommendation depends on which we are in:

  1. Greenfield or modernizing (preferred): do not install. Use framework-native atomic locks behind an internal LockService interface so driver and semantics stay swappable without touching call sites.
  2. Already depending on Locker: do not rip-and-replace blind. Introduce the internal interface first, implement it by delegating to Locker, and build behavioral tests (contention, TTL expiry, crash-release, non-owner release). Then swap the delegate to native locks and run the identical suite for parity. In this path Locker's value is as an executable behavioral spec, not as a runtime dependency.

Compatibility. Verify four things concretely: composer.json PHP and illuminate/* constraints against the actual runtime; package auto-discovery support; driver coverage versus the backends we run (Redis vs database vs file); and whether the 2020 release targets the framework version in use. Because the repo is archived, any mismatch is a permanent condition, not a scheduling problem.

Sequencing.

  1. Inventory every lock call site and classify by correctness criticality (money movement > idempotency guards > rate limiting > cosmetic).
  2. Run the composer constraint probe per application.
  3. Decide: adopt, fork, or replicate natively. Record the decision as an ADR.
  4. If adopt/fork: pin an exact version, vendor under an internal namespace, and stand up CI with a driver matrix and real concurrency integration tests.
  5. If replicate: define the internal interface, implement on native locks, port the behavioral tests.
  6. Remove all Locker references and close the dependency.

Operational Impact

Maintenance. Zero upstream. Archived plus a 2020-07-25 final release means no dependency bumps, no PHP 8.x fixes, no CVE response. The cost does not disappear; it converts into either a hard version ceiling on the application or a permanently owned internal fork. MIT makes forking clean and the codebase is small enough that a fork is bounded and plausible — but it becomes a standing line item, not a one-off task.

Support. No maintainers, no issue triage, no security channel. Escalation is internal-only. For a component on a correctness boundary, that fact outweighs both the star count and the code quality.

Scaling. All scaling characteristics belong to the driver, and the manager abstraction does not change any of the curves — it only selects among them. Redis gives good throughput but lock durability is bounded by Redis availability; failover or resharding can silently drop a held lock. Database locks are workable at low write rates and degrade under contention while adding load to the primary. File and array drivers are single-host only and invalid the moment we scale horizontally. Blocking acquires hold PHP-FPM workers, so contention converts directly into worker-pool exhaustion — a capacity-planning concern, not merely a locking one.

Failure modes. Enumerate these explicitly, because every one is silent:

  • Holder dies without releasing → deadlock until TTL. Long TTL stalls the queue; short TTL lets two workers into the same critical section.
  • Release without owner-token verification → one process deletes another's lock.
  • Clock skew across nodes → premature lease expiry.
  • Redis/Memcached eviction or failover → lock vanishes mid-critical-section.
  • Blocking acquire with no timeout → request pile-up and cascading latency.
  • No reentrancy handling → self-deadlock in nested code paths.
  • Driver mismatch between environments (file in dev, Redis in prod) → concurrency defects that appear only under production load.

Ramp-up. The API is small and Laravel-idiomatic; a mid-level engineer is productive in a day. The real ramp-up is conceptual — lease sizing, idempotency at the critical-section boundary, and failure-injection testing. Budget there, not for learning the package. Read the score profile (0.44 overall against 7.77 opportunity) as a signal that distributed locking is an unmet need in this stack, and address the need with native primitives rather than a six-year-dormant dependency.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console