Laravel: Cannot generate migration file with make:

2019-09-18 15:48发布

问题:

I've got an ongoing project and migrations were working fine. But I don't know if something has changed, now php artisan make:migration my_migration_name is not generating a migration file and not showing any errors as well.

I've tried running it with -v verbosity flag but nothing is printed on terminal. My directory permissions seem to be fine;

I've also tried running it with sudo but I got this error message;

I've updated composer and tried to remove laravel and reinstall laravel/framework '5.1'. But nothing seem to help.:(

If someone has faced this kind of issue and managed to resolve it, help would be really appreciated. Any suggestion how to resolve this issue?

回答1:

I've got it working somehow. It was really weird behavior and tried different solutions to get it working. I thought I should list down steps I follow to get it working, for someone who may get into this type of behavior.

Short and quick solution might be to clear all your cached data and application configs.

php artisan cache:clear # clear all cached files.
php artisan config:clear # clear application config cache
composer dump-autoload # reload all autoload classes

And quit the "TERMINAL" and reopen it, hope it should be working now.

If it still don't work then try following options and repeat above mentioned part;

  • Re-install your laravel/framework using composer. I found it while searching for solution
  • Check your directory permissions, see if you have write permissions.

Hope! It may help someone.