Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChizoba Eze
PHP Development Techdegree Graduate 21,777 PointsTarget class [CoursesTableSeeder] does not exist.
I had an error that said Target class [CoursesTableSeeder] does not exist. I found that you need to run the composer dumpautoload
command to generate a new classmap every time you add a file to database/, otherwise it will not be autoloaded.
composer dumpautoload
Then seed the seeder
php artisan db:seed
3 Answers
Robert Stefanic
35,170 PointsPerfect. This worked for me. Thank you!
Jack Jackson
6,082 PointsI got stuck on this too using Laravel 8.6.0. Make sure both Seeders files have this at the top:
namespace Database\Seeders;
Marco Claassen
3,475 PointsThanks! This worked for me.
Manuel Soto
1,436 PointsThis did not work for me :( Illuminate\Contracts\Container\BindingResolutionException
Target class [CoursesTableSeeder] does not exist.