laravel include path to make migration

Viewed 181

I need to add migrations to separate folder other than default migrations folder.

Here's the project structure:

root_project_name 
   -- app
   -- bootstrap
   -- .
   -- .
   -- database
      -- dmf_migrations
      -- migrations

I tried the following commands from the root project path:

php artisan make:migration create_dmf_result_set_table --path=/dmf_migrations/

Also tried:

  • dmf_migrations
  • /database/dmf_migrations/
  • database/dmf_migrations

I get this error:

In ClassLoader.php line 444:

include(C:\xampp\htdocs\comp-intel-app\source\cpi\vendor\composer/../../database/migrations/2020_05_21_082135_create_dmf_result_set_table.php): failed to open stream: No such file
  or directory

What's the correct path?

1 Answers

You need to create dmf_migrations folder in your project's root directory.

Then run it with:

php artisan make:migration create_dmf_result_set_table --path=dmf_migrations

If you prefer to have it in database/dmf_migrations, then create dmf_migrations subfolder in database and run:

php artisan make:migration create_dmf_result_set_table --path=database/dmf_migrations
Related