Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel create migration file in specific folder

I've created Payment package for my laravel projectlike here

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
like image 471
merdan Avatar asked Jul 27 '19 08:07

merdan


1 Answers

Use this command on the root folder:

create the only Migration file:

php artisan make:migration create_products_table --create=products

Create Migration, Model file:

php artisan make:model Product -m

For Create Migration,Model,Controller file:

php artisan make:model Product -mcr

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

If you want to migrate then:

php artisan migrate --path="/app/database/migrations/relations"
like image 101
Dilip Hirapara Avatar answered Sep 23 '22 00:09

Dilip Hirapara