Class "Faker\Factory" not found

Hi! So I’ve been trying to deploy a Laravel app. I mounted a volume and attached it to the 1 fly machine I have for this project. I was able to successfully use the volume for my sqlite database, but the issue arises when I try to populate the database with my seeders, specifically I get the issue:

{“message”:“Class "Faker\Factory" not found”,“context”:{“exception”:{“class”:“Error”,“message”:“Class "Faker\Factory" not found”,“code”:0,“file”:“/var/www/html/vendor/laravel/framework/src/Illuminate/Database/DatabaseServiceProvider.php:93”}},“level”:400,“level_name”:“ERROR”,“channel”:“production”,“datetime”:“2025-01-15T22:25:24.934183+00:00”,“extra”:{}}

when I try to populate my database on production:

/var/www/html# php artisan db:seed --class=DatabaseSeeder

I do not get this error on local development.

I tried multiple things like ‘composer dump-autoload’ and ‘composer update’ but I just can’t find the error.

Thanks!

Faker is usually included in composer require-dev. Is your Dockerfile doing composer install --no-dev? If so you’ll need to move the faker requirement to the require section.