Replies: 3 comments 4 replies
-
Faker is a dev dependency - if you've deployed to forge, it won't have installed those. If you need to generate random seed data in production, you'll need to move it into a normal dependency - or don't use random data/faker in the seeders. |
Beta Was this translation helpful? Give feedback.
-
This case is like I experienced, the solution I found is not to use User::factory(1)->create(); but use User::create([ .... ]); |
Beta Was this translation helpful? Give feedback.
-
Thank you, this helped me. I also found out that it will work if you add "fakerphp/faker": "^1.23" to the "require" section of Composer.json. Either that or you can run composer install without the --no-dev flag. |
Beta Was this translation helpful? Give feedback.
-
Laravel Version
11
PHP Version
8.3
Database Driver & Version
No response
Description
Hi I have double-checked my Laravel app with filament and there are only vendor files using the faker library I am not using it in my code, but Forge is showing this error:
In DatabaseServiceProvider.php line 93:
Class "Faker\Factory" not found
I have seen some people say move faker to required in composer but I find it strange as I haven't used faker in my code, so do not need it in production, thanks
Steps To Reproduce
Seed data in Forge, keep faker in dev on composer file.
Beta Was this translation helpful? Give feedback.
All reactions