Laravel 8: Table Seeder
sahamilton opened this issue · 4 comments
Using a clean install of Laravel 8 when running composer dump-autoload
Deprecation Notice: Class Ichtrojan\Location\Seeds\StatesTableSeeder located in C:/laragon/www/mapminer4/vendor/ichtrojan/laravel-location/src\database\seeds\StatesTableSeeder.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar://C:/laragon/bin/composer/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201
So when the seeders are run the following error is received:
Target class [Ichtrojan\\Location\\Seeds\\LocationDatabaseSeeder] does not exist.
As a workaround add the below to your composer.json
"autoload": {
<...>
"psr-4": {
<...>
"Ichtrojan\\Location\\Seeds\\": "vendor/ichtrojan/laravel-location/src/database/seeds/"
}
},
I am having the same error @ichtrojan
STEPS TO REPRODUCE
Laravel 8
PHP 7.4
- composer require ichtrojan/laravel-location
ERROR:
Class Ichtrojan\Location\Seeds\LocationDatabaseSeeder does not exist
Run
composer dump-autoload