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 trial

PHP Laravel Basics MVC (Model) Deploying Migrations

Chizoba Eze
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chizoba Eze
PHP Development Techdegree Graduate 21,777 Points

Target 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
Robert Stefanic
35,170 Points

Perfect. This worked for me. Thank you!

I 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
Marco Claassen
3,475 Points

Thanks! This worked for me.

This did not work for me :( Illuminate\Contracts\Container\BindingResolutionException

Target class [CoursesTableSeeder] does not exist.