levaral-dev / core-v2
此包已被弃用,不再维护。未建议替代包。
Laravel 框架的 Levaral 基础包
dev-master
2019-02-27 07:52 UTC
Requires
- php: ^7.0
- doctrine/common: ^2.9@dev
- doctrine/dbal: ^2.5
- gossi/php-code-generator: dev-master
- guzzlehttp/guzzle: ~6.0
- laravel/framework: 5.7.*|5.8.*
This package is not auto-updated.
Last update: 2021-01-30 03:01:06 UTC
README
composer require levaral-dev/core-v2:dev-master
命令
此命令将生成基本结构。
levaral:structure
此命令将生成模型的所有基本类。
levaral:levaral:generate-model-base
此命令将生成所有[API 路由/ API 服务]的纯 JavaScript 对象
levaral:api-js
此命令将在 Actions 文件夹中生成动作类。
make:action {namespace}
例如
make:action 'User\Profile\GetDetail'
此命令将在 Domain 文件夹中生成模型和基本类。
make:model {namespace}
此命令将扫描 Api
文件夹中的所有 Actions 并生成测试类
levaral:generate-test
此命令将为前端生成语言文件
levaral:generate-language-json
动作路由
动作路由可以在任何 Laravel 路由文件中定义,如 (web.php, api.php 等),当使用动作路由时,您不需要定义命名路由,它将自动生成。
例如
Action::get('get-detail', \App\Http\Actions\User\GetDetail::class); // route name User:GetDetail Action::post('get-detail', \App\Http\Actions\User\PostDetail::class); // route name User:PostDetail Action::post('get-detail', \App\Http\Actions\User\PostDetail::class); // route name User:PostDetail Action::post('get-detail', \App\Http\Actions\User\Profile\GetDetail::class); // route name User:Profile:PostDetail
模型
文档进行中