Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel PHP Fatal Error: Class 'Table' not found with migrate command

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?

like image 846
Adam Silva Avatar asked Dec 06 '14 22:12

Adam Silva


1 Answers

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.

like image 93
Adam Silva Avatar answered Oct 08 '22 01:10

Adam Silva