正如标题所说;有没有一种方法可以删除/还原/回滚运行php artisan make:model MyModel -mcr
时创建的文件的创建?
类似的东西:
php artisan destroy:model MyModel
..并“级联”删除所有相关文件?
答案 0 :(得分:4)
只需手动完成,撰写本文时无命令
...database/migrations
文件夹中删除迁移php artisan migrate
,请登录到phpmyadmin或SQL(视情况而定),并在数据库中,删除由迁移创建的表为我工作,希望对您有所帮助!
答案 1 :(得分:1)
运行时
php artisan make:model --help
必须看到的命令
Usage:
make:model [options] [--] <name>
Arguments:
name The name of the class
Options:
-a, --all Generate a migration, factory, and resource controller for the model
-c, --controller Create a new controller for the model
-f, --factory Create a new factory for the model
--force Create the class even if the model already exists
-m, --migration Create a new migration file for the model
-p, --pivot Indicates if the generated model should be a custom intermediate table model
-r, --resource Indicates if the generated controller should be a resource controller
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose outp
ut and 3 for debug
这意味着您默认它是不可能的。您必须为此制定自己的工匠命令。另外,如果您想了解工匠的命令选项和参数,请使用
php artisan command_name --help