Skip to content
Advertisement

Reflection Exception : Class does not exist for manually added class

I added a seeder (copied from elsewhere and pasted) to my application and included the call in the Database Seeder run() function. I get the exception above even though the class exists.

I suspected that maybe some files may have been cached so i cleared the application cache but i still get the same error.

DatabaseSeeder.php

JavaScript

Seeder file CategoriesTableSeeder.php

JavaScript

Error:

ReflectionException : Class CategoriesTableSeeder does not exist

at C:wampwwwma-sales-trackervendorlaravelframeworksrcIlluminateContainerContainer.php:788

Exception trace:

1 ReflectionClass::__construct(“CategoriesTableSeeder”) C:wampwwwma-sales-trackervendorlaravelframeworksrcIlluminateContainerContainer.php:788

2 IlluminateContainerContainer::build(“CategoriesTableSeeder”) C:wampwwwma-sales-trackervendorlaravelframeworksrcIlluminateContainerContainer.php:667

Any ideas on what might be causing this? Thanks in advance guys

Advertisement

Answer

I run Composer dump-autoload and voila! Worked as a charm. Also as suggested by Alex Mac, always generate Seeders with artisan commands.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement