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
Module Manager

Module Manager Laravel Package

nasirkhan/module-manager

Laravel module manager for Laravel Starter with version tracking, migration baselines/updates, dependency checks, publish/diff workflows, and enable/disable lifecycle commands. Includes scaffolding, removal, and test generation via Artisan.

View on GitHub
Deep Wiki
Context7

Module Manager adds robust module lifecycle tooling to Laravel Starter, with built-in version tracking, migration management, and dependency resolution. It helps you keep packaged modules and your published Modules/ overrides in sync, while providing a clear CLI for day-to-day maintenance.

  • Module status & visibility: inspect enabled/disabled state, versions, and dependencies
  • Dependency checks: verify module requirements are satisfied before enabling
  • Migration tooling: baseline tracking, update detection, and unpublished migration checks
  • Publish & diff workflow: publish modules for customization and compare changes (module:diff)
  • Lifecycle commands: enable/disable, scaffold (module:build), remove, and generate tests
Frequently asked questions about Module Manager
How do I install Module Manager in a Laravel Starter project?
Run `composer require nasirkhan/module-manager` in your project root. Ensure your Laravel version is 12 or 13 and PHP is 8.3+. No additional configuration is needed for basic functionality, but review the `module.json` structure for custom modules.
Can I use this package with a non-Laravel Starter project?
Module Manager is tightly coupled with Laravel Starter’s directory structure (e.g., `Modules/`). While you could adapt it, you’d need to manually override conventions like service providers, migrations, and namespace isolation. Consider alternatives like `laravel-modules` if you’re not using Starter.
What’s the difference between `module:publish` and `module:diff`?
`module:publish` copies a module’s files from the vendor directory to your `Modules/` folder for customization. `module:diff` compares the published version with the original package to show changes, helping you track modifications before updates.
How does dependency resolution work if two modules require different versions of the same package?
Module Manager checks `module.json` dependencies before enabling a module. If conflicts exist (e.g., `Post@1.0` requiring `Category@1.0` while `Category@2.0` is installed), the command fails with a clear error. Use `module:dependencies` to pre-check compatibility.
What’s the safest way to update a module’s migrations after a `composer update`?
Run `php artisan module:detect-updates {module}` to identify new migrations, then `php artisan module:track-migrations {module} --force` to baseline the updated state. Always back up your database before forcing migration tracking.
Does Module Manager support runtime module enabling/disabling?
Yes. Use `module:enable {module}` or `module:disable {module}` to toggle modules at runtime. Disabled modules won’t load their service providers, routes, or migrations, making it ideal for feature flags or A/B testing.
How do I scaffold a new module with custom templates?
Use `module:build {module-name}`. To extend templates (e.g., add middleware), override the default scaffolding in `vendor/nasirkhan/module-manager/src/ModuleBuilder.php` or publish the package’s views with `php artisan vendor:publish --tag=module-manager-templates`.
What happens if I run `module:track-migrations --force` and it corrupts my database?
There’s no built-in rollback for migration tracking. Always verify the baseline state with `module:check-migrations` before forcing updates. For critical systems, manually back up your migrations table (`migrations`) or use database transactions during the process.
Can I generate tests for existing modules, or only new ones?
You can generate tests for both. Use `module:make-test {module} {test-name}` for new modules or existing ones. The command creates a test class in `Modules/{module}/Tests/` with stubs for common module interactions (e.g., routes, controllers).
How does Module Manager handle shared resources between modules (e.g., a `User` module used by `Post` and `Comment`)?
Shared resources should be published once (e.g., `module:publish User`) and referenced via dependency in `module.json`. Module Manager doesn’t enforce shared logic but relies on Laravel’s autoloading. For complex shared code, consider extracting it to a standalone package or using Laravel’s `config/module-shared.php`.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4