Weave Code
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

Laravel Modules Laravel Package

nwidart/laravel-modules

Modularize large Laravel apps with nwidart/laravel-modules. Create self-contained modules (controllers, models, views, routes, config) with Artisan generators, module discovery, enabling/disabling, and per-module resources—tested and maintained across modern Laravel versions.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Modular Monolith Architecture: Adopt a modular approach to decompose a large Laravel application into independent, reusable modules (e.g., Auth, Payments, Inventory). This aligns with the "microservices-lite" pattern, improving maintainability and team autonomy without full microservice complexity.
  • Feature-Flagged Development: Enable/disable modules dynamically (e.g., module:disable Payments during a refactor) to isolate work in progress. Supports canary releases or A/B testing by toggling modules per environment.
  • Build vs. Buy: Avoid reinventing module management (e.g., custom composer.json merging, route isolation, or namespace handling). The package handles 90% of modularity boilerplate, reducing dev time by weeks.
  • Roadmap Prioritization:
    • Phase 1: Split monolithic app into modules (e.g., Auth, Billing) to parallelize development.
    • Phase 2: Gradually migrate modules to standalone services (using this package’s isolation as a stepping stone).
    • Phase 3: Replace legacy spaghetti routes with module-specific RouteServiceProviders.
  • Use Cases:
    • Multi-tenant SaaS: Isolate tenant-specific features (e.g., TenantA/Payments, TenantB/Invoicing) as modules.
    • Legacy Refactoring: Incrementally replace old controllers/models with modular versions (e.g., module:make Controller UserProfile).
    • Third-Party Plugins: Distribute modules as Composer packages (e.g., vendor/module-paypal).

When to Consider This Package

  • Adopt if:

    • Your Laravel app has >50 routes, >20 controllers, or >3 models with overlapping concerns (e.g., User, Order, Payment).
    • Teams struggle with merge conflicts or slow CI builds due to monolithic codebases.
    • You need runtime module toggling (e.g., disable Analytics module for GDPR compliance).
    • Your stack includes Laravel 8–13 and PHP 8.0+ (check compatibility table).
    • You want built-in support for:
      • Module-specific migrations/seeds (php artisan module:seed Payments).
      • Vite/Laravel Mix asset compilation per module.
      • Database-backed module activation (via FileActivator).
  • Look elsewhere if:

    • Your app is <10K LoC or has no clear feature boundaries (modularity adds overhead).
    • You’re using Laravel <8.0 or PHP <8.0 (package drops legacy support).
    • You need true microservices (this is for monoliths; use Lumen or Sail for services).
    • Your team lacks Composer or Artisan familiarity (setup requires composer merge-plugin).
    • You prioritize serverless (modules assume traditional Laravel hosting).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us scale development teams without technical debt by breaking our monolith into independent modules—like Lego blocks for features. For example:

  • Auth team can work on Modules/Auth without blocking the Payments team.
  • We can toggle modules live (e.g., disable Marketing during outages) without redeploying.
  • Third-party vendors can contribute modules (e.g., module-stripe) via Composer. Cost: ~2 dev-days to migrate; ROI: Faster releases, easier hiring, and future microservice readiness."*

For Engineers:

*"Laravel-Modules solves 5 critical pain points in large apps:

  1. Namespace Hell: Modules auto-generate namespaces (e.g., Modules\Payments\Controllers\CheckoutController).
  2. Route Isolation: Each module gets its own RouteServiceProvider (no more routes/web.php bloat).
  3. Asset Scoping: Vite/Mix compiles assets per module (e.g., resources/js/modules/payments/).
  4. Dynamic Enabling: Disable Modules/Analytics during GDPR audits with php artisan module:disable Analytics.
  5. Boilerplate: Generates controllers, migrations, factories, and even event providers in one command (php artisan module:make Payments). Tradeoff: Slightly slower composer install (due to merge-plugin), but worth it for maintainability."*

For Architects:

*"This aligns with Domain-Driven Design (DDD) by enforcing:

  • Bounded Contexts: Each module encapsulates a subdomain (e.g., Modules/Inventory vs. Modules/Shipping).
  • Strategic DIP: Modules depend on Laravel’s core but not on each other (easy to extract later).
  • Infrastructure as Code: Module statuses can be stored in database (via FileActivator) or filesystem (default). Risk: Over-modularization can fragment team knowledge—mitigate with module ownership (e.g., team-payments owns Modules/Payments)."*
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope