Laravel 4 walkthrough: class exception not found

So now I get this strange error when I want to migrate my database

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class '' not found","file":"C:\\xampp\\htdocs\\l4crm\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Migrations\\Migrator.php","line":301}}[Finished in 1.3s] 

All that is needed for the work, of course, does not matter which files I try to transfer (I tried only to transfer one table and then another, they all give the same error)

Any ideas? I looked at him for more than one hour.

Also, composer-dump-autoload doesn’t do the trick.

My composer.json also downloads migrations.

+4
source share
5 answers

I seem to have solved the problem.

To make it easier to determine the migration order, I renamed the migration files to something like

 1_create_users_table.php 2_create_..._table.php 3_create_..._table.php 

etc. Apparently, this gave me an error, she really needed to stay in the format yyyy_mm_dd_hhmmss_create_xxx_table.php .

+9
source

I had the same problem, I searched on the Internet, and I found this solution that you should update the automatically generated classmap (aka autoload) with this command:

 php composer.phar update 

or

 composer update 

check this link: I found a solution here

+10
source

if composer dump-autoload does not work, check the class name in the migration file. The class name must be the same as the file name without a date

+3
source

I had the same problem.

For me, composer update does not work (in other situations) with Windows for unknown reasons.

But,

 composer dump-autoload 

work.

+3
source

In my case, I deleted the migration in the source files, but I did not get into the "migrations" table in the database.

Delete the line and update the migration and run the command "dump-autoload -o"

0
source

Source: https://habr.com/ru/post/1499943/


All Articles