layman/laravel-architect
Composer 安装命令:
composer require layman/laravel-architect
包简介
Laravel package for generating controllers, requests, models, and repositories from configuration.
README 文档
README
Generate Laravel controllers, form requests, models, and repositories from config/architect.php.
Generated controllers use spatie/laravel-route-attributes by default.
Installation
Install the package in a Laravel application:
composer require layman/laravel-architect
Laravel package discovery registers Layman\LaravelArchitect\ArchitectServiceProvider automatically.
Publishing
Publish the config file:
php artisan vendor:publish --tag=architect-config
Publish the default stubs if you want to customize generated code:
php artisan vendor:publish --tag=architect-stubs
By default, published stubs are copied to artisan-generator-stubs.
Usage
Generate all configured artifacts:
php artisan architect:make User
Generate selected artifact types:
php artisan architect:make User --only=controller --only=request
Overwrite existing generated files:
php artisan architect:make User --force
Nested module names are supported:
php artisan architect:make Admin/User
Use {{modulePath}} in config/architect.php paths if nested module names should also affect output namespaces.
Configuration
config/architect.php controls namespaces and generated files:
'namespace' => [ 'controller' => 'App\Http\Controllers', 'request' => 'App\Http\Requests', 'repository' => 'App\Repositories', 'model' => 'App\Models', ], 'template' => [ 'files' => [ 'controller' => [ 'path' => 'Backend', 'name' => '{{module}}Controller', 'stub' => 'controller.stub', ], ], ],
Supported placeholders include {{module}}, {{module_snake}}, {{module_kebab}}, {{module_camel}}, {{module_plural}}, {{module_plural_snake}}, {{table}}, and {{variable}}.
The default controller stub adds #[Prefix('{{module_snake}}')], uses #[Post(...)] for every action, and sets #[Defaults('description', '')].
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-18