Laravel - PHP Fatal error: Class 'CreateMatchesTable' not found in migrate:refresh
Asked Answered
S

2

7

Recently I cleaned up my tables locally, and this resulted in me deleting 'Match' table. I am now receiving errors on the production server because of this.

Locally, I ran php artisan migrate:reset, deleted the 'CreateMatchesTable' file and then php artisan migrate:refresh --seed. This worked locally and I then pushed my most recent build to the server.

Now, whenever I run php artisan migrate:refresh --seed on the production server, I'm presented with the following error:

PHP Fatal error:  Class 'CreateMatchesTable' not found in
/home/forge/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php
on line 301
PHP Stack trace:
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException",
        "message":"Class 'CreateMatchesTable' not found","file":"\/home\/forge
         \/vendor\/laravel\/framework\/src\/Illuminate\/Database\/Migrations\/
         Migrator.php","line":301}}

I have read about other people experiencing this and I've tried composer dump-autoload- but the problem still persists.

Also, php artisan dump-autoload unfortunately presents me with this error:

Generating optimized class loader
Compiling common classes

  [ErrorException]            
  Array to string conversion  

dump-autoload

I've deleted the site and rolled back migrations on Laravel Forge, and still, when it pulls the latest build into Forge this error occurs!

Swiss answered 31/10, 2014 at 13:13 Comment(0)
A
13

You should delete the row from your migrations table in your database.

Alpenhorn answered 31/10, 2014 at 13:53 Comment(1)
If you still get the issue then you should do - composer dump-autoload - as suggested by Hos Mercury (in the other answer). That worked for meKratzer
W
12

The solution for that is

composer dump-autoload
Well answered 22/11, 2015 at 0:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.