Laravel在特定文件夹中创建迁移文件 [英] Laravel create migration file in specific folder

查看:1046
本文介绍了Laravel在特定文件夹中创建迁移文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的laravel项目创建了付款程序包

I've created Payment package for my laravel project

我想在我的软件包的migrations文件夹内制作迁移文件.如何使用artisan命令创建它? 我想要类似

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 root folder

php artisan make:migration create_products_table --create=products//仅创建迁移文件

php artisan make:model Product -m//创建迁移模型文件

php artisan make:model Product -m //Create Migration, Model file

php artisan make:model Product -mcr//用于创建迁移,模型,控制器文件

php artisan make:model Product -mcr //For Create Migration,Model,Controller file

如果要手动执行操作,则可以根据文件夹要求设置--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

这篇关于Laravel在特定文件夹中创建迁移文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆