Laravel: Cannot generate migration file with make:migration command

雨燕双飞 提交于 2019-12-25 07:59:04

问题


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.



来源:https://stackoverflow.com/questions/41480576/laravel-cannot-generate-migration-file-with-makemigration-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!