obarlas/laravel-migrate-custom-command
Composer 安装命令:
composer require obarlas/laravel-migrate-custom-command
包简介
Creates database migration files from custom templates.
README 文档
README
Purpose of this package is to create database migration files from custom templates since custom migration templates are not available in Laravel.
Instead of hard coding table names in the migration class, I prefer to use global variables so I can just copy/paste the same creation and foreign key strings to other migration files easily, also I have default columns on my tables so this prevents me from rewriting every database migration file.
Usage
- You must add the package to your app config.
'Obarlas\LaravelMigrateCustomCommand\LaravelMigrateCustomCommandServiceProvider',
-
In the
src/stubsfolder of the package original stubs from the Laravel package can be found, create and copy them to yourdatabase/templatesfolder. Now you can edit the stubs according to your needs. -
Usage is simple
php artisan migrate:custom stub_name class_name --table=table_name
migrate:customcommand checks if there is a{{table}}variable in the stub file, and if no--tableargument is passed it stops.
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-05-28