EDIT: TL;DR. The problem is with Docker for Windows. (Original thread follows.)
It's too bad that "Composer" isn't a category/topic on here because I feel like a good percentage of the time, the issue has to do with Composer, not Laravel.
Anyhow, I have this head scratcher here. I have two vanilla Laravel 7 projects going, let's call them A and B.
Project B is literally bare bones, as in, I just created it from scratch using composer create-project.
Project A I started a week ago. The only thing I've done so far on project A is to try to reverse engineer a large remote database to migrations, seeds and models, using 3 of my favorite --require-dev extensions.
The remote database has (yes, not a typo) 700 tables and another 1,200 views. The existence of the massive folder full of files in database/migrations and database/seeds is the only difference I can see between the two projects.
The psr-4 and classmap sections of composer.json are the same on both projects.
When I do a composer dump-autoload, everything works fine on both projects, meaning the terminal output looks the same and there are no errors.
php artisan migrate:fresh --seed works on the tiny shell project B.
php artisan migrate works on project A.
php artisan db:seed does not work on project A due to:
Illuminate\Contracts\Container\BindingResolutionException
Target class [DatabaseSeeder] does not exist.
For the life of me, I cannot figure out why composer is refusing to include the DatabaseSeeder.php file in vendor/composer/autoload_classmap or vendor/composer/autoload_static
So I manually add it, just to see what's going on. Upon inspection, I am seeing that
root@37dd7e2b7563:/var/www/vhosts/ProjectA$ cat vendor/composer/autoload_classmap.php | grep Database | grep Seeder | wc -l
551
root@37dd7e2b7563:/var/www/vhosts/ProjectA$ ls -la database/seeds/ | wc -l
1119
about half of the database seeders actually made it into composer's dump autoload files, and I am at a loss to explain it.
I ran it like this, too:
php -d memory_limit=-1 composer.phar dump-autoload
thinking it could be memory related (silent issue) but the same thing is happening.
Composer version 2.0.8 2020-12-03 17:20:38
Developing on Windows using a custom Docker setup (nginx, PHP-fpm)
PHP Version 7.4
Any ideas? I am stumped.