Team-Tea-Time / laravel-forum

A slim, lean forum package designed for quick and easy integration in Laravel projects
https://laravel-forum.teamteatime.net/
MIT License
601 stars 165 forks source link

How to seed? #274

Closed niloc7 closed 2 years ago

niloc7 commented 3 years ago

I've tried for hours to seed the database using php artisan db:seed --class=TeamTeaTime\Forum\Database\Seeds\ForumSeeder

It always returns: Target class [TeamTeaTime\Forum\Database\Seeds\ForumSeeder] does not exist.

The only difference is that I am using Laragon instead of a docker app.

Any pointers on what I might be doing wrongly?

Riari commented 3 years ago

I've noticed issues with this before and thought I had solved it. I'm not really sure why it's broken, so I'll have to investigate when I can and get back to you.

In the meantime, you should be able to copy the seeder to your own application, change the namespace, run composer dump-autoload, and run the seeder again with the new namespace.

Riari commented 2 years ago

Quick update on this. I wasn't able to figure out why artisan won't run the seeder via the namespace, but I added a forum:seed command in 5.2.1, which is now the recommended method for seeding.