laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.33k stars 10.96k forks source link

Incorrectly placed seeders #36547

Closed yarkm13 closed 3 years ago

yarkm13 commented 3 years ago

https://github.com/laravel/framework/blob/b7ceae1761de6839e37b70a65177e702b1b4a38f/src/Illuminate/Database/Console/Seeds/SeederMakeCommand.php#L69-L76

If you have both database/seeders and database/seeds directories php artisan make:seeder UserSeeder will place UserSeeder.php file to seeds but with incorrect namespace Database\Seeders;.

As result you can't use it in default database/DatabaseSeeder as docs say.

Upgrade guide 7 to 8 contains section about upgrading old seeders:

In addition, the previous database/seeds directory should be renamed to database/seeders

so may be this condition is unnecessary now?

Some packeges can make seeds dir by its own e.g. tcg/voyager do that and than application start to behave incorrectly

taylorotwell commented 3 years ago

Not sure you should have both directories?