Laravel Fatal Error Class Not Found when migrating

后端 未结 11 2115
后悔当初
后悔当初 2021-02-02 11:39
  1. I\'ve run artisan migrate:reset.

  2. I\'ve deleted some of my migration files because I didn\'t need these tables anymore.

  3. I

11条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 12:12

    I solved my problem by

    1. Removing all migration
    2. Running composer dump-autoload
    3. Adding them back one by one and running php artisan migrate
    4. Deleting those that caused Laravel to throw an error
    5. Create new migrations to replace the deleted ones

    I'm not sure why that worked but my guess is that I might have modified the class name of these problematic migrations in the past.

    I also found that renaming the migration with its initial name (The one throwed with the fatal error) also works for some of them.

提交回复
热议问题