alex-claimer/generator

描述:alex-claimer/generator 库

安装: 40

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

语言:JavaScript

dev-master / 3.1.x-dev 2019-07-16 16:58 UTC

This package is not auto-updated.

Last update: 2024-09-23 17:52:40 UTC


README

尚不稳定。从数据库表生成类:模型、控制器(尚为空)、仓库、请求、观察器和视图(尚未)。

用法

composer require --dev alex-claimer/generator

php artisan vendor:publish --tag=alex-claimer-generator-config

设置在 config/alex-claimer-generator/config.php

url: Your_project/generator_create_migration

php artisan generate:migration {{parameters}} - 生成迁移

{{parameters}} - { posts - 为 'posts' 表创建迁移;

posts_comments - 为 'posts' 和 'comments' 表创建迁移;

posts__comments - 为 'posts' 、 'comments' 和关联表 'pivot_post_comments' 创建迁移;

posts___comments - 仅为关联表 'pivot_post_comments' 创建迁移;

posts_prefix_test - 为 'test_posts' 表创建迁移;

posts__comments_prefix_test - 为 'test_posts' 、 'test_comments' 和关联表 'test_pivot_post_comments' 创建迁移;

带有列的关联

'post_id'     on   'test_posts' 

'comment_id'     on   'test_comments'`                      

}

php artisan migrate

php artisan generate:classes - 从数据库生成类

url: Your_project/generator_menu

生成的类在 config/alex-claimer-generator/already_made.php

如需再次生成类,请从 config/alex-claimer-generator/already_made.php 中删除。