nasirkhan/module-manager
| Install | |
|---|---|
composer require nasirkhan/module-manager |
|
| Latest Version: | v8.4.1 |
| PHP: | ^8.3 || ^8.4 |
| Laravel: | 12 · 13 |
| Older releases: | 11 |
| License: | MIT |
| Last Updated: | Oct 20, 2026 |
| Links: | GitHub · Packagist |
Module Manager for Laravel Starter

Module Manager is a powerful module management package for Laravel Starter, providing version tracking, migration management, dependency resolution, and comprehensive module lifecycle management.
Requirements
- PHP ^8.3
- Laravel ^12.0 || ^13.0
📦 Installation
composer require nasirkhan/module-manager
Quick Start
php artisan module:status # View all modules and their status
php artisan module:dependencies # Check module dependencies
php artisan migrate # Run pending migrations
Available Commands
Core
| Command | Description |
|---|---|
module:status [module] |
View module status, versions, and dependencies |
module:dependencies [module] |
Check dependency satisfaction |
module:publish {module} |
Publish a module to Modules/ for customization |
module:diff {module} [--detailed] |
Compare package version with published version |
module:enable {module} |
Enable a module |
module:disable {module} |
Disable a module |
module:build {module} |
Scaffold a new module |
module:remove {module} |
Remove a module |
module:make-test {module} {name} [--unit] |
Generate a test class for a module |
module:help [topic] |
Show command reference and workflows |
Migration Management
| Command | Description |
|---|---|
module:track-migrations [module] [--force] |
Record current migration state as baseline |
module:detect-updates [module] |
Detect new migrations after a composer update |
module:check-migrations [module] |
Check for unpublished migrations |
Module Structure
Modules/Post/
├── module.json
├── Config/
├── Console/
├── database/
│ ├── migrations/
│ ├── seeders/
│ └── factories/
├── Http/
│ ├── Controllers/
│ ├── Requests/
│ └── Middleware/
├── Livewire/
├── Models/
├── Providers/
├── Resources/
├── routes/
├── lang/
├── Tests/
│ ├── Feature/
│ └── Unit/
└── Resources/
└── views/
Module Configuration (module.json)
{
"name": "Post",
"alias": "post",
"description": "Blog post management module with categories, tags, and moderation",
"version": "1.0.0",
"keywords": ["post", "blog", "article", "content"],
"priority": 0,
"requires": ["Category", "Tag"]
}
priority: Load order — higher values load first (e.g.10for core deps,5for UI,0for content)requires: Module names this module depends on
Publishing Module Assets
php artisan vendor:publish --tag=post-migrations
php artisan vendor:publish --tag=post-views
php artisan vendor:publish --tag=post-config
php artisan vendor:publish --tag=post-lang
Namespace Architecture
| Location | Namespace |
|---|---|
vendor/nasirkhan/module-manager/src/Modules/ |
Nasirkhan\ModuleManager\Modules\{Module}\... |
Modules/ (published) |
Modules\{Module}\... |
When publishing a module (module:publish), all namespaces are rewritten automatically. After publishing, run:
composer dump-autoload
php artisan config:clear
Troubleshooting
Module not showing in status:
composer dump-autoload
php artisan cache:clear && php artisan config:clear
Migrations not detected after update:
php artisan module:track-migrations --force
php artisan module:detect-updates
php artisan vendor:publish --tag=post-migrations
php artisan migrate
Programmatic API
ModuleVersion
use Nasirkhan\ModuleManager\Services\ModuleVersion;
$service = app(ModuleVersion::class);
$service->getVersion('Post'); // "1.0.0"
$service->getDependencies('Post'); // ['Category', 'Tag']
$service->dependenciesSatisfied('Post'); // bool
$service->getModulesByPriority(); // ordered module list
MigrationTracker
use Nasirkhan\ModuleManager\Services\MigrationTracker;
$tracker = app(MigrationTracker::class);
$tracker->trackModuleMigrations('Post', '1.0.0');
$tracker->getNewMigrationsSinceLastCheck('Post');
$tracker->getPendingMigrations('Post');
$tracker->hasUpdates('Post');
Contributing
See CONTRIBUTING.md for development guidelines.
License
MIT License. See LICENSE for details.
Available Modules
| Module | Version | Description | Dependencies |
|---|---|---|---|
| Post | 1.0.0 | Blog post management with moderation | Category, Tag |
| Category | 1.0.0 | Category management with nested sets | — |
| Tag | 1.0.0 | Polymorphic tagging system | — |
| Menu | 1.0.0 | Dynamic menu with nested items | — |
Image previews on edit forms
The Post, Category, and Tag module edit forms display a thumbnail of the currently saved image alongside the file input. When an image is attached, the form renders a PhotoSwipe-compatible gallery block that opens the full-size image in an overlay on click:
<div class="pswp-gallery">
<figure>
<a href="https://github.com/nasirkhan/module-manager/blob/HEAD/storage/posts/photo.jpg" data-pswp-src="/storage/posts/photo.jpg">
<img src="https://raw.githubusercontent.com/nasirkhan/module-manager/HEAD/storage/posts/photo-thumb300.jpg" class="rounded img-thumbnail" alt="" />
</a>
</figure>
</div>
This markup is output by each module's form.blade.php partial. PhotoSwipe itself is initialised by the host application — Laravel Starter does this automatically in resources/js/photoswipe.js. If you use these modules in a custom host application, ensure PhotoSwipe is installed (npm install photoswipe) and initialised for any .pswp-gallery element.
Related Packages
Speeds up Laravel development by automating repetitive tasks. This package helps...
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v8.4.1 | ^8.3 || | ^12.0 || | MIT | |
| v8.4.0 | ^8.3 || | ^12.0 || | MIT | |
| v8.3.0 | ^8.3 || | ^12.0 || | MIT | |
| v8.2.0 | ^8.3 || | ^12.0 || | MIT | |
| v8.1.0 | ^8.3 || | ^12.0 || | MIT | |
| v8.0.0 | ^8.3 || | ^12.0 || | MIT | |
| v7.4.1 | ^8.3 || | ^12.0 || | MIT | |
| v7.4.0 | ^8.3 || | ^12.0 || | MIT | |
| v7.3.0 | ^8.3 || | ^12.0 || | MIT | |
| v7.2.0 | ^8.3 || | ^12.0 || | MIT | |
| v7.1.0 | ^8.3 || | ^12.0 || | MIT | |
| v7.0.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.9.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.8.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.7.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.6.1 | ^8.3 || | ^12.0 || | MIT | |
| v6.6.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.5.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.4.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.3.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.2.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.1.0 | ^8.3 || | ^12.0 || | MIT | |
| v6.0.0 | ^8.3 | ^12.0 || | MIT | |
| v5.7.0 | ^8.2 | ^v12.0 | MIT | |
| v5.6.0 | ^8.2 | ^v12.0 | MIT | |
| v5.5.0 | ^8.2 | ^v12.0 | MIT | |
| v5.4.0 | ^8.2 | ^v12.0 | MIT | |
| v5.3.0 | ^8.2 | ^v12.0 | MIT | |
| v5.2.0 | ^8.2 | ^v12.0 | MIT | |
| v5.1.0 | ^8.2 | ^v12.0 | MIT |
Showing the latest 30 of 56. See every release on Packagist