cedarsol/larmod
Composer 安装命令:
composer require cedarsol/larmod
包简介
A module scaffolding tool for ERP-style Laravel applications. Quickly generate fully-structured modules with controllers, models, services, routes, and more.
README 文档
README
A module scaffolding tool for ERP-style Laravel applications.
LarMod provides an Artisan command to quickly generate fully-structured modules with controllers, models, services, routes, and more — giving your Laravel ERP project a clean, modular architecture from the start.
Requirements
- PHP 8.2+
- Laravel 11 or 12
Installation
Via Composer (Packagist)
composer require cedarsol/larmod --dev
Local Development (Path Repository)
If you're developing LarMod locally, add a path repository to your Laravel project's composer.json:
{
"repositories": [
{
"type": "path",
"url": "packages/larmod"
}
]
}
Then require it:
composer require cedarsol/larmod --dev
Note: Laravel auto-discovers the service provider — no manual registration needed.
Usage
Generate a Module
php artisan make:erp-module Inventory
This creates the following structure:
Modules/
└── Inventory/
├── Http/
│ ├── Controllers/
│ │ └── InventoryController.php
│ ├── Requests/
│ └── Resources/
├── Models/
│ └── Inventory.php
├── Services/
│ └── InventoryService.php
├── database/
│ └── migrations/
└── routes.php
Options
| Option | Description |
|---|---|
--force |
Overwrite existing module files without prompt |
php artisan make:erp-module Inventory --force
Register Module Namespace
After generating a module, add its namespace to your project's composer.json autoload:
{
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\Inventory\\": "Modules/Inventory/"
}
}
}
Then regenerate the autoloader:
composer dump-autoload
Load Module Routes
Include the module's routes in your application. For example, in bootstrap/app.php (Laravel 11+):
->withRouting( web: __DIR__.'/../routes/web.php', api: __DIR__.'/../routes/api.php', then: function () { Route::prefix('api') ->middleware('api') ->group(base_path('Modules/Inventory/routes.php')); }, )
Or in a route service provider:
Route::prefix('api') ->middleware('api') ->group(base_path('Modules/Inventory/routes.php'));
Customizing Stubs
Publish the stub templates to customize them:
php artisan vendor:publish --tag=larmod-stubs
This copies the stubs to stubs/vendor/larmod/ in your project root. LarMod will use your customized stubs instead of the package defaults.
Available Placeholders
| Placeholder | Example Output | Description |
|---|---|---|
{{ namespace }} |
Modules\Inventory |
Module's root namespace |
{{ class }} |
Inventory |
StudlyCase module name |
{{ moduleName }} |
Inventory |
Module name (same as class) |
{{ moduleNameLower }} |
inventory |
Lowercase module name |
{{ moduleNameSlug }} |
inventory |
Kebab-case module name (URL-safe) |
{{ moduleNamePlural }} |
inventories |
Snake_case pluralized (for tables) |
Publishing to Packagist
1. Create a GitHub Repository
cd packages/larmod git init git add . git commit -m "Initial release of LarMod" git remote add origin git@github.com:your-username/larmod.git git push -u origin main
2. Tag a Release
git tag v1.0.0 git push --tags
3. Register on Packagist
- Go to https://packagist.org and sign in with GitHub
- Click Submit and enter your repository URL:
https://github.com/your-username/larmod - Packagist will read your
composer.jsonand register the package ascedarsol/larmod - Set up the GitHub webhook for automatic updates:
- In your GitHub repo → Settings → Webhooks → Add webhook
- Payload URL:
https://packagist.org/api/github?username=YOUR_PACKAGIST_USERNAME - Content type:
application/json - Secret: your Packagist API token
- Events: Just the push event
4. Install from Packagist
Once published, anyone can install it:
composer require cedarsol/larmod --dev
Example Workflow
# Generate modules for an ERP application
php artisan make:erp-module Inventory
php artisan make:erp-module Sales
php artisan make:erp-module HumanResource
php artisan make:erp-module Accounting
php artisan make:erp-module Procurement
Each module gets a clean, consistent structure ready for business logic.
License
MIT License. See LICENSE for details.
cedarsol/larmod 适用场景与选型建议
cedarsol/larmod 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「module」 「laravel」 「modular」 「scaffolding」 「architecture」 「ERP」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cedarsol/larmod 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cedarsol/larmod 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cedarsol/larmod 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Silverstripe content blocks module
Enterprise-Grade Modular Architecture for Laravel Applications - A powerful Laravel package that revolutionizes application development with robust Service Repository Pattern, Dynamic Module Management, and 50+ Artisan commands for scalable, maintainable applications.
Create laravel modular app using laravel modular plugin
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Yii2 module to manage website content. Kind of a CMS...
Alfabank REST API integration
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-28