定制 atilla/submodules 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-02