【发布时间】:2020-12-24 22:56:48
【问题描述】:
阅读 laravel-modules 如何为 laravel 6 工作
https://nwidart.com/laravel-modules/v6/advanced-tools/artisan-commands
我没有找到如何创建新的迁移文件。我尝试了两种方法,但都失败了:
root@95e2f26acdf8:/app/Modules/Opportunities# php artisan make:migration leads_table_add_test_id_fields --table=leads
Could not open input file: artisan
root@95e2f26acdf8:/app/Modules/Opportunities# php artisan make:migration Opportunities leads_table_add_test_id_fields --table=leads
Could not open input file: artisan
root@95e2f26acdf8:/app/Modules/Opportunities# cd ../
root@95e2f26acdf8:/app/Modules# cd ../
root@95e2f26acdf8:/app# php artisan make:migration Opportunities leads_table_add_test_id_fields --table=leads
Too many arguments, expected arguments "command" "name".
修改:
是的,那个命令
php artisan module:make-migration leads_table_add_test_fields Opportunities
工作正常。但我尝试将 --table= 选项添加为
php artisan module:make-migration leads_table_add_test_fields Opportunities --table=opportunities
但出现错误:
The "--table" option does not exist.
?
哪种方式正确?
【问题讨论】:
-
php artisan module:make-migration module_name,请阅读所有文档
-
stackoverflow.com/a/57230550/9978078 请检查此答案以在特定文件夹中创建新迁移。
-
请看已修改
-
nwidart 在我阅读时不支持额外的迁移命令
标签: laravel