Search code examples
phplaravelmigrationlaravel-artisanlaravel-5.4

I can't generate migration file with make:migration command in Laravel


This happened to me a couple of months ago. It might have happened in the process of a composer update, but I'm far from sure on that one. I've even updated my project to Laravel 5.3 and it still I can not get make:migration to work through Artisan. No the project it updated to 5.4 and it still do not work.

I've checked out this thread and I have the exact same problem. The symptoms were exactly the same, however the OPs solutions did not work for me.

  • I get no error or result in the terminal when running make:migrate.
  • I can generate any other file through Artisan it seems.
  • I tried to create a new model and pass the -m along with it. Didn't work.
  • I've checked permissions (and even changed migration folder), but didn't help.
  • If I create my own migration-file the rest of the process through artisan works fine (migrate, DB-manipulation etc).
  • I've tried with different terminals and computers.
  • Since project were upgraded and even reinstalled I fear it has nothing to do with the deep kernal. However maybe some sort of conflict from the higher level.
  • And in the last phase of my quest I tried to figure out what user interacting elements that can possibly effect the make:migration. Nothing worked.

I searched the web without any solution, then I gave up on that project and started to make my own migration files. However I now got some new hope when I saw that other thread.


Solution

  • After some troubleshooting I finaly managed to figure out the problem. I narrowed it down to have something to do with the config/app.php-file. Seems I in this project had typed in:

    'timezone' => 'UTC+2'

    This made creation of migration-files come to a halt without error messages. And it effected only the creation of migration-files (at least what I noticed).

    I changed it to 'UTC' and it worked liked a charm again.

    Note: the 'UTC+2' worked in the application and I never saw any other indications of errors regarding the rest of the app.php-file, or in the application in general.

    Solution: When I instead used the parameters from this site it all worked perfectly again.