PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 7, 2022

[FIXED] Laravel create migration file in specific folder

 March 07, 2022     laravel, laravel-5, laravel-artisan, migration     No comments   

Issue

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

Solution

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"


Answered By - Dilip Hirapara
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing