drivkraft/interlock
drivkraft/interlock is a Laravel package that adds lightweight interlocking primitives to help coordinate concurrent work, prevent overlapping jobs, and guard shared resources against race conditions with simple, reliable locks.
app/Modules/* folder plus bespoke service-provider registration) or an existing modules package. Interlock bundles discovery, scaffolding, and generator parity in one dependency, which reframes the decision from "do we write our own module loader?" to "do we adopt this and contribute, or fork?"module:make with part selection (--web, --api, --views, --lang, --migrations, --factories, --seeders, --tests, --all) plus custom stubs turns "here is our 40-step new-module checklist" into one command. That is a measurable onboarding lever: time-to-first-merged-PR for a new hire, and cost per new bounded context.module:action activates only when lorisleiva/laravel-actions is present; module:data only when spatie/laravel-data is present; Livewire namespacing is opt-in. The package does not force a stack decision, so it can coexist with a roadmap that hasn't settled on actions/DTOs/Livewire yet. That keeps later technology bets reversible.interlock.discover and configurable interlock.routes and interlock.directories mean a pilot module can ship before a company-wide mandate. This is the difference between a 2-week spike and a 6-month migration program.module:cache / module:clear hooked into optimize and optimize:clear, plus autoloading through wikimedia/composer-merge-plugin that survives optimised and authoritative classmaps, means the architecture does not impose a production or CI tax. "Modularity costs us latency or build time" is a common objection this pre-empts.module:* counterparts of Laravel's make:* generators with identical options plus --module means engineers keep muscle memory and documentation stays accurate. That is a concrete adoption-risk reduction, and a reason to prefer this over a homegrown loader.module:remove/module:rename. If boundary enforcement is the strategic goal, boundary checking is the natural next investment (in-house or upstream).Adopt when:
Look elsewhere when:
For executives (one paragraph): We are proposing to structure our Laravel application as a modular monolith — one application, one deploy, but internally divided into clearly named business domains with a shared, standardised way of adding new ones. This buys us most of the organisational benefit of splitting into services (clear ownership, independent feature teams, contained blast radius for changes) without the operational bill: no new infrastructure, no separate deployment pipelines, no distributed-systems complexity. Concretely, it targets two costs we already feel: slow onboarding into an increasingly tangled codebase, and inconsistent structure across teams. The main caveat is a version dependency — the tooling requires the newest Laravel and PHP releases, so adoption is tied to our framework upgrade timeline, and it is a young project, so we would pilot it on one module and keep a fork-and-own fallback rather than betting the platform on it unexamined.
For engineering leadership: The pitch is developer velocity and structural consistency, not architecture astronautics. module:make replaces a manual checklist with a single command that produces web/api routes, views, translations, migrations, factories, seeders and tests on demand, and custom stubs let us bake our own conventions in so new code looks like our code by default. Thirty module:* generators mirror Laravel's own make:* commands with identical options plus --module, so there is essentially no relearning. Discovery is automatic but controllable: each type (routes, views, translations, components, commands, listeners, migrations, factories) can be toggled off, route groups are chosen by filename with web and api on by default, and a cached discovery manifest is wired into optimize and optimize:clear so we get production boot performance for free. Autoloading runs through wikimedia/composer-merge-plugin so optimised and authoritative classmaps still work — no CI surprises. Livewire, laravel-actions and spatie/laravel-data are picked up only if we already use them, so this does not pre-commit us to a stack. What we are asking for: approval for a scoped pilot on one non-critical module, contingent on our Laravel 13 / PHP 8.5 upgrade timeline, with a written exit plan (the discovery layer is thin enough to reimplement in-house if the project stalls). What we are not claiming: this does not enforce boundaries at runtime, and it does not replace a decision about eventual service extraction — it defers that decision cheaply, which is the point.
How can I help you explore Laravel packages today?