1 year ago

make:migration uses last weeks date! throws failed to open stream error

Posted 1 year ago by roemer


It seems like I've somehow messed up the migration naming system in a very odd way.

An hour ago, I created a new migration and noticed that it wasn't sorted properly in the migrations folder. I quickly noticed that the reason for this was that it used the date of 7 days ago, in this case may 2nd 2018. Since the last migration I created was on the same day, but slightly later in the day, my new migration would actually be executed before the one from last week.

Confused, I checked the system date of my Homestead instance and there it was, the date was a week behind! Somehow, the system date was still may 2nd. Easy fix I thought, I'll just update the system date (sudo date --set "9 MAY 2018 13:50:00" and sudo dpkg-reconfigure tzdata) and try creating the migration again! Weirdly enough, I got this error:

php artisan make:migration document_nr_and_addresses_table

In ClassLoader.php line 444:

  t_nr_and_addresses_table.php): failed to open stream: No such file or directory

It's still using last weeks date! Even though the output of date in the command line is now correct.

Things I've tried:

  • Rebooting
  • php artisan cache:clear
  • composer dump-autload
  • Running date('Y-m-d H:i:s') in a tinker session in the Homestead box. This outputs the correct date and time!

Unfortunately, nothing worked.

Any ideas?

Please sign in or create an account to participate in this conversation.