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

Modular Laravel Package

internachi/modular

A lightweight module system for Laravel using Composer path repositories and Laravel package discovery. Organize large apps by placing self-contained “modules” in an app-modules/ directory, following standard Laravel package conventions with minimal extra tooling.

View on GitHub
Deep Wiki
Context7

Modularize your Laravel apps

Frequently asked questions about Modular
How do I create a new module with internachi/modular?
Use the extended Artisan commands with the `--module` flag, like `php artisan make:model User --module=users`. This generates the model inside `app-modules/users/` with proper namespacing. The package leverages Laravel’s package discovery, so no extra bootstrapping is needed after creation.
Does internachi/modular work with Laravel 11+ only?
Yes, this package explicitly targets Laravel 11+ to align with modern features like Eloquent model factories and Blade components. Older versions (pre-9.x) are unsupported, as the package relies on Laravel’s updated package discovery system.
Can I share modules as standalone Composer packages?
No, modules are tied to your project via Composer path repositories, which are project-specific. To share a module, you’d need to refactor it into a standalone package and manually manage dependencies. The package prioritizes simplicity over portability.
How does dependency management work across modules?
Modules declare dependencies in their own `composer.json`, but shared dependencies (like `laravel/framework`) must be managed at the root level to avoid conflicts. Peer dependencies (e.g., `spatie/laravel-permission`) can be specified per module, but conflicts must be resolved manually.
Will this slow down `composer install` in large projects?
Yes, scanning `app-modules/*` for auto-discovery can add overhead, especially with many modules. For CI/CD pipelines, consider caching Composer dependencies or running `composer install --no-scripts` to mitigate this.
How do I namespace Blade components for modules?
Use the namespaced syntax `<x-module::component>` in Blade templates. The package auto-discovers components under `resources/views/module/` with proper namespacing, so no extra configuration is required beyond following the `app-modules/` structure.
Can I use module-specific database migrations?
Yes, run `php artisan db:seed --module=users` to execute module-scoped migrations or seeders. Migrations are stored in `database/migrations/module/` and follow Laravel’s standard migration conventions.
What IDE support is available for modules?
PhpStorm syncs automatically with the `app-modules/` structure, but other IDEs (like VSCode) may require manual configuration. The package provides no built-in tooling for dynamic IDE integration, so custom setups or source maps may be needed.
How do I test modules without cluttering the root phpunit.xml?
Use the `modules:sync` command to integrate module-specific tests into the root test suite. However, this can clutter the configuration. For better isolation, consider splitting tests into separate suites or using module-specific `TestCase` base classes.
What’s the difference between this and nwidart/laravel-modules?
This package is lighter, using Laravel’s native package discovery and Composer path repos instead of introducing new abstractions. It lacks dynamic module loading/unloading (e.g., plugins) but avoids vendor lock-in. `nwidart/laravel-modules` offers more features but with heavier tooling.
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