wanglelecc / laracms-generator
扩展LaraCMS生成器脚手架。
v1.0.0
2018-11-17 16:26 UTC
Requires
- php: >=7.1.3
This package is auto-updated.
Last update: 2024-08-27 04:31:59 UTC
README
LaraCMS Scaffold Generator,用于Laravel 5.7
安装
步骤1:通过Composer安装
composer require 'wanglelecc/laracms-generator' --dev
步骤2:运行Artisan命令!
设置完成。从控制台运行php artisan
,你将看到新的命令make:laracms-administrator
。
示例
使用此命令生成项目中项目的脚手架
php artisan make:scaffold Projects --schema="name:string:index,description:text:nullable,subscriber_count:integer:unsigned:default(0)"
此命令将生成:
$ php artisan make:scaffold Projects --schema="name:string:index,description:text:nullable,subscriber_count:integer:unsigned:default(0)"
----------- scaffolding: Project -----------
+ ./database/migrations/2017_04_17_065656_create_projects_table.php
+ ./database/factories/ModelFactory.php
+ ./database/seeds/ProjectsTableSeeder.php
+ ./database/seeds/DatabaseSeeder.php (Updated)
x ./app/Models/Model.php (Skipped)
+ ./app/Models/Project.php
+ ./app/Http/Controllers/ProjectsController.php
x ./app/Http/Requests/Request.php (Skipped)
+ ./app/Http/Requests/ProjectRequest.php
+ ./app/Observers/ProjectObserver.php
+ ./app/Providers/AppServiceProvider.php (Updated)
x ./app/Policies/Policy.php
+ ./app/Policies/ProjectPolicy.php
+ ./app/Providers/AuthServiceProvider.php (Updated)
+ ./routes/web.php (Updated)
--- Views ---
+ create_and_edit.blade.php
+ index.blade.php
+ show.blade.php
x ./resources/views/error.blade.php
Migrated: 2017_04_17_065656_create_projects_table
----------- -------------------- -----------
----------- >DUMP AUTOLOAD< -----------
说明
生成以下内容
- 迁移文件
- 种子文件,添加ModelFactory条目和DatabaseSeeder条目
- 基础模型类,模型和助手特质
- 资源控制器
- 基础表单请求类和StoreRequest,UpdateRequest
- 策略和策略基类,自动注册AuthServiceProvider类
- 更新路由文件以注册资源路由
- 添加错误页面视图
- 创建和编辑动作共享相同的视图