正如标题所说;有没有办法删除/恢复/回滚运行时创建的文件的创建php artisan make:model MyModel -mcr?
就像是:
php artisan destroy:model MyModel
..它“级联”删除所有相关文件?
只需手动完成,在撰写本文时没有命令
...database/migrations文件夹中删除迁移php artisan migrate,请登录您的 phpmyadmin 或 SQL(无论哪种情况)并在您的数据库中,删除迁移创建的表对我有用,希望能帮到你!
当你跑步时
php artisan make:model --help
Run Code Online (Sandbox Code Playgroud)
你必须看到的命令
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
Run Code Online (Sandbox Code Playgroud)
这意味着默认情况下它是不可能的。你必须为它制定你自己的工匠命令。另外,如果您想了解 artisan 命令选项和参数,请使用
php artisan command_name --help
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3749 次 |
| 最近记录: |