Laravel 在特定文件夹中创建迁移文件 [英] Laravel create migration file in specific folder
本文介绍了Laravel 在特定文件夹中创建迁移文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为我的 laravel 项目创建了支付包
I've created Payment package for my laravel project
我想在我的包的迁移文件夹中制作迁移文件.如何使用工匠命令创建它?我想要类似的东西
I want to make migration files inside migrations folder of my package. How can create it using artisan command? I want something like
php artisan make:migration packages/Payment/src/Database/add_orderId_to_cart_payment_table
推荐答案
在根文件夹上使用这个命令:
Use this command on the root folder:
创建唯一的迁移文件:
php artisan make:migration create_products_table --create=products
创建迁移,模型文件:
php artisan make:model Product -m
对于创建迁移、模型、控制器文件:
For Create Migration,Model,Controller file:
php artisan make:model Product -mcr
如果您想手动执行,则可以根据您的文件夹要求设置 --path
.
If you want to do it manually then you may set --path
as per your folder requirement.
php artisan make:migration filename --path=/app/database/migrations/relations
php artisan make:migration filename --path=/app/database/migrations/translations
如果你想迁移,那么:
php artisan migrate --path="/app/database/migrations/relations"
这篇关于Laravel 在特定文件夹中创建迁移文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文