"failed to open stream" error when executing "migrate:make"


I am trying to create a simple database migration. But when I run the following command in the root directory of my project:

php artisan migrate:make --create=users create_users_table

I get the following error:

[ErrorException]

file_put_contents(/var/www/blog/app/database/migrations/2015_12_20_052832_create_users_table.php): failed to open stream: No such file or directory

I am using the latest version of OctoberCMS and am getting the same error both on Linux and Windows. How can I fix this?

Answer

The command is wrong for the latest version of OctoberCMS. To create a new migration, you should run this:

php artisan make:migration create_users_table --create=users

Also, you should create the path of migrations because it does not created at the installation of OctoberCMS.

# execute from the root app folder
mkdir -p database/migrations
source: stackoverflow.com
js interview questions