nasirkhan/module-manager
Composer 安装命令:
composer require nasirkhan/module-manager
包简介
Module Manager & Generator for Laravel Starter Kit (https://github.com/nasirkhan/laravel-starter)
README 文档
README
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 | — |
nasirkhan/module-manager 适用场景与选型建议
nasirkhan/module-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 44.22k 次下载、GitHub Stars 达 10, 最近一次更新时间为 2022 年 11 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Laravel Starter」 「Module Manager」 「module generator」 「nasirkhan」 「nasirkhansaikat」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 nasirkhan/module-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nasirkhan/module-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 nasirkhan/module-manager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel Filament Starter.
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Slim starter / Slim skeleton package to boost your development with Slim framework
Yii2 module to manage website content. Kind of a CMS...
Alfabank REST API integration
A Craft CMS scaffolding project
统计信息
- 总下载量: 44.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 22
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-14