beauty-framework/module-support
Composer 安装命令:
composer require beauty-framework/module-support
包简介
Beauty Module Support
README 文档
README
Installation
Add the package to your project via Composer:
composer require beauty-framework/module-support
The next step is to write the routing in the config config/router.php:
return [ 'controllers' => [ __DIR__ . '/../modules/*/src/Controllers/**/*Controller.php', ], ];
And at the last step, in bootstrap/kernel.php add
$bootstrap = new class { use \Beauty\Module\Core\HasModuleSupportTrait; /** * @return object * @property array $middlewares * @property ContainerManager $containerManager * @property array $routerConfig */ public function boot(): object { // ... } // ... }
And in the same file, in the initContainerManager method, add the following to line 83:
return ContainerManager::bootFrom(array_merge( $containers, $this->findModuleContainerClasses(), [Config::class, Base::class, DI::class] ));
Quick Start: Module Generation
1. Generate a new module
Use the built-in command to generate a new module:
./beauty generate:module <module-name>
<module-name>— your module name (in lowercase; dashes and underscores will automatically be converted to StudlyCase for the namespace).- The module will appear in
modules/<module-name>, with a ready-to-usesrc/structure and standard subfolders.
Example:
./beauty generate:module hello-world
This will create:
modules/hello-world/
├─ src/
│ ├─ Controllers/
│ ├─ Services/
│ ├─ Repositories/
│ ├─ Middlewares/
│ ├─ Entities/
│ ├─ DTO/
│ ├─ Events/
│ └─ Listeners/
│ └─ Container/DI.php
└─ composer.json
- The module's composer.json will contain a ready psr-4 autoloading config with the namespace
Module\HelloWorld\. - The root composer.json will be automatically patched with a path repository and dependency on your new module.
2. Register the module generation command
To make the generate:module command available for all CLI Beauty runs, register it in your config:
Open config/commands.php and add:
return [ ... \Beauty\Module\Console\RegisterCommands::commands(), ... ];
Done!
Now you can create new modules with a single command. Beauty will handle the rest.
For custom templates or advanced file generation, see the "Advanced Usage" section in the upcoming documentation.
beauty-framework/module-support 适用场景与选型建议
beauty-framework/module-support 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 06 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「beauty」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 beauty-framework/module-support 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 beauty-framework/module-support 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 beauty-framework/module-support 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Yii2 module to manage website content. Kind of a CMS...
Codeurx Modular is simply a package for Laravel to help you create and manage modules.
The beauty Library.
The beauty Framework.
User Module for the Attogram Framework
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-22