sinemacula/laravel-modules
A modular structuring package for Laravel applications, providing a foundation for organizing code into self-contained modules. Useful for teams building maintainable, scalable apps with clear separation of concerns.
Architecture fit. sinemacula/laravel-modules is a modularisation layer for Laravel applications, giving each module its own namespace, service providers, routes, migrations, resources, and now model factories. v1.4.0 continues a maturation trend rather than a feature-expansion trend: three of the seven fixes are about failing gracefully and reporting accurately (cache write failures no longer crash, unusable manifests are ignored, empty resource paths are reported), and one is about path canonicalisation. For a TPM, this signals the package is moving from "works in the happy path" to "survives messy enterprise filesystems and CI environments" — a good signal for adoption in multi-team codebases where modules are authored by different squads.
Integration feasibility. Low friction. No new required dependencies, no configuration schema changes called out, and the changes are additive or defensive. The two features most likely to touch our code are:
Database\Factories without explicit registration. This is opt-in in practice (you only benefit if you use conventional naming), but it can silently change which factory a test picks up if a module has a factory whose name collides with a conventionally-resolved one.Technical risk. Assessed as low-to-moderate. There are no BREAKING CHANGE footers and the release is a minor bump, consistent with SemVer. The residual risk is behavioural rather than API-level:
current symlinks). This is the single highest-value thing to verify in our environment.Key questions for the maintainer / our own spike.
$model on the factory?php-cs-fixer pin (#82) that affects our own linting pipeline if we share the config?Stack fit. Targets Laravel's service-provider and package-discovery model, so it drops into a standard Laravel app with no bootstrap surgery. It is a convention package — the cost of adoption is agreeing on module boundaries and naming, not wiring. v1.4.0's factory convention and stub standardisation both reduce the amount of per-module boilerplate our teams write, which is the main long-term maintenance win here.
Migration path. Adopt incrementally, not big-bang:
--parallel disabled first (to expose any factory-resolution ordering effects from #66).Compatibility. No PHP or Laravel version constraints are signalled as changed by this release. The php-cs-fixer pin (#82) is dev-tooling only and should not affect runtime consumers, but it may cause a CI diff if we vendor a shared style config. Confirm the package's supported Laravel range against our current major before scheduling — this is the one item the release notes do not answer and it gates everything else.
Sequencing. Treat v1.4.0 as a stability upgrade, not a feature upgrade. Slot it into the next routine dependency-bump window rather than a dedicated project. The only candidate for pulling forward is #69/#77 if we have observed flaky behaviour around module caching or manifest reads — in that case, prioritise it, because those are the two fixes that convert a crash into a diagnosable event.
Maintenance. Net reduction in toil. Standardised stubs (#67) mean fewer one-off module skeletons drifting apart; convention-based factories (#66) remove a class of "why can't my test find the factory" tickets. The php-cs-fixer pin and git-hook reliability work (#64, #82) point at a maintainer who is investing in reproducible CI — a positive leading indicator for the package's longevity.
Support. Diagnostics improve materially in this release: rewritten module names are reported (#79), resource paths pointing at empty modules are reported (#72), and cache write failures are reported rather than thrown (#69). Each of these converts a previously opaque failure into an actionable message. The open question is where those reports land — we must confirm they route into our existing log aggregation and are not silently swallowed at a verbosity level we don't run in production.
Scaling. Module count is the scaling axis, and two changes matter: manifest usability handling (#77) affects cold-start and cache-warm behaviour as module count grows, and base-path discarding (#78) matters for any module served from a shared or deep directory tree. Neither introduces new scaling cost; #77 plausibly removes one (repeated manifest reads). Recommend a light benchmark at our current module count and at roughly 2x, comparing cold request latency before and after the upgrade.
Failure modes to watch.
Ramp-up. Minimal. A developer familiar with Laravel package conventions can be productive in under a day; the module layout is the only new mental model. Plan roughly 1–2 engineer-days for the upgrade, dominated by the staging validation of #70/#77 rather than by code changes, plus a short internal note documenting the factory convention and the base-path option so teams don't independently discover and configure them inconsistently.
How can I help you explore Laravel packages today?