To change the default locale used by Faker, the easiest way is to simply override the FakerGenerator binding with your specific concrete implementation:
// AppServiceProvider.php $this->app->singleton(FakerGenerator::class, function () { return FakerFactory::create('nl_NL'); });
At the top of your AppServiceProvider.php file AppServiceProvider.php add the following lines:
use Faker\Generator as FakerGenerator; use Faker\Factory as FakerFactory;
For example, the code above would mean that all instances of Faker are created using the nl_NL provider, thus creating Dutch faker data.
Remember: this should happen after the DatabaseServiceProvider is executed, so be sure to place your own AppServiceProvider after all the Laravel ServiceProviders in your config.php array.
source share