Laravel Fatal Error Class Not Found when migrating

后端 未结 11 2156
后悔当初
后悔当初 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 11:53

    I had the same problem. When I was hiting php artisan migrate:reset, I got Class 'CreateImagesTable' not found. And composer dump-autoload didn't help.

    My solution was very easy:

    1. php artisan make:migration create_images_table --create=images
    2. composer dump-autoload
    3. Then I got: SQLSTATE[HY000]: General error: 1 no such table: images (SQL: drop table "images")
    4. so in sqlite I typed: CREATE TABLE `images` ( ...> `id` INTEGER ...> );
    5. And then php artisan migrate:reset
    6. Now I'm happy again

提交回复
热议问题