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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:03:47  来源:igfitidea点击:

Laravel 5.0 php artisan make:model ModelName auto creating migration class

laravellaravel-5

提问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:modelshows a list of available cli arguments for the make:modelcommand.

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 --migrationto generate one.

更新 [2015]
从 5.1 开始,不再自动创建迁移。您可以使用该标志--migration生成一个。