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!

Cleb
  • 25,102
  • 20
  • 116
  • 151

2 Answers2

13

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

Patrick Reck
  • 11,246
  • 11
  • 53
  • 86
  • 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 me – skay- Apr 03 '16 at 14:10
12

The solution for that is

composer dump-autoload
Cleb
  • 25,102
  • 20
  • 116
  • 151
mercury
  • 2,390
  • 3
  • 30
  • 39