Laravel 5.0 php artisan make:model ModelName 自动创建迁移类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28853628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel 5.0 php artisan make:model ModelName auto creating migration class
提问by user1404963
Laravel's command: php artisan make:model ModelName
Laravel 的命令:php artisan make:model ModelName
automatically creating creating migration class with the Model Name. Is there are way that we could pass additional parameters to the make:model command so that it ignores creating migration class?
使用模型名称自动创建创建迁移类。有没有办法可以将附加参数传递给 make:model 命令,以便它忽略创建迁移类?
回答by Jad Joubran
You should write this command:php artisan make:model modelName --no-migration
你应该写这个命令:php artisan make:model modelName --no-migration
Artisan CLI providers a help message for all commands.
For instance php artisan help make:model
shows a list of available cli arguments for the make:model
command.
Artisan CLI 为所有命令提供帮助信息。
例如,php artisan help make:model
显示make:model
命令的可用 cli 参数列表。
UPDATE [2015]:
Starting 5.1, migrations are not automatically created anymore. You can use the flag --migration
to generate one.
更新 [2015]:
从 5.1 开始,不再自动创建迁移。您可以使用该标志--migration
生成一个。