atilla/submodules
最新稳定版本:v0.1.3
Composer 安装命令:
composer require atilla/submodules
包简介
A Laravel package for generating and managing modular API applications
README 文档
README
A Laravel package for generating modular API applications.
Installation
Install via Composer:
composer require atilla/submodules
The package will automatically register its service provider.
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=submodules-config
This will create config/submodules.php where you can customize:
- Modules path
- Base namespace
- Directory structure
- Files to generate
- Route configurations
- View settings
Usage
Creating a Module
php artisan make:module Blog
This will generate a new module with the following structure:
src/SubModules/Blog/
├── Controllers/
│ └── BlogController.php
├── Models/
│ └── Blog.php
└── Providers/
└── BlogServiceProvider.php
... etc
Options
--force- Overwrite existing module
Generated Files
Each module includes:
- ServiceProvider
- Controller with CRUD + API actions
- Eloquent Model
- Basic routing configuration
Customization
Custom Stubs
Publish the stub files to customize the generated code:
php artisan vendor:publish --tag=module-generator-stubs
Configuration
Key settings in config/submodules.php:
return [ 'submodules_path' => 'src/SubModules', 'namespace' => 'SubModules', 'structure' => [ 'Controllers', 'Models', 'Providers', // More to come... ], 'files' => [ 'service_provider' => true, 'controller' => true, 'model' => true, // Configure which files to generate... ] ];
Requirements
- PHP 8.1+
- Laravel 9.0+
License
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-02