Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Error:
In ClassMapGenerator.php line 131:
Could not scan for classes inside "database/seeds" which does not appear to be a file nor a folder
Solution:
Check the Directory Structure: Ensure that the directory database/seeds still exists. If you’re using Laravel 8 or newer, this directory should be named database/seeders. You can fix this by either renaming the folder or by updating your autoload settings.
- Rename
database/seedstodatabase/seeders.
mv database/seeds database/seedersUpdate Composer Autoload Settings: In case renaming doesn’t work or if you’ve already updated your folder structure, ensure that your composer.json file reflects the correct paths.
- Open
composer.jsonand ensure that it referencesdatabase/seedersinstead ofdatabase/seeds.
jsonCopy code"autoload": {
"classmap": [
"database/seeders"
]
}- Then, run the following command to regenerate the autoload files:
codecomposer dump-autoloadClear Cache: Sometimes Laravel caches can cause such issues. You can try clearing Laravel’s cache to see if that helps resolve the issue:
php artisan config:clear
php artisan cache:clearCheck for Hardcoded Paths: If you’ve hardcoded the database/seeds path anywhere in your codebase, replace it with database/seeders.

Leave a Reply