7

I'm using Laravel, and I'm trying to migrate some tables to my DB(phpmyadmin). It was giving me some trouble before, so I eliminated all the rows in the migration table in the DB, so now it has nothing. So I try to run 'php artisan migrate' and I get the following error:

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

I don't have any table or class named 'Table'. Anyone know what's wrong?

1
  • Can you post what your migration looks like? Commented Dec 7, 2014 at 0:54

2 Answers 2

20

I already solved this. I discovered that migration files follow a certain format. For example, I had my files like this: 001_create_user_admin_table.php

And I discovered that the format has to be yyyy_mm_dd_hhmmss_name_of_file.php It has to have those first four arguments, that's why up top it said I couldn't find a Class 'table', because the way I had it before, table was my 5th argument in the file name.

Sign up to request clarification or add additional context in comments.

2 Comments

Saved my day. I did the exact same thing with renaming migrations. Thanks for the tip!
It'd be nice if there was a more helpful error message or something in the documentation that mentioned this!
5

try to execute this command : composer dump-autoload

Ysee

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.