Search code examples
laravellaravel-4composer-phplaravel-artisanartisan-migrate

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


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!


Solution

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