This problem is not new, but I’ve looked and tried all the proposed solutions in other threads with no success. I’m working with Laravel 8 with Homestead, is a new installation on a Windows 10 machine, not an upgrade. I’m trying to seed a file called HotelSeeder.php. When I run the command
php artisan db:seed
I get the next error:
My HotelSeeder class goes like this:
My DatabaseSeeder class goes like this:
Both classes are located in the directory database/seeders
Autoload in composer.json goes like this:
After I run vagrant up and vagrant ssh, the commands that I’m running are:
php composer auto-load
php artisan db:seed
And the error shows up.
I've tried also:
php artisan db:seed --class=HotelSeeder
php artisan migrate:fresh –seed
php artisan clear:cache
php artisan optimize
Nothing seems to work. I hope you can help me.
Try the command:
composer dump-autoload --optimize
then:
php artisan db:seed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With