From cf9822aff2f37d27464dcdbc917bc8c7a30986b3 Mon Sep 17 00:00:00 2001 From: Dwight Watson Date: Mon, 13 Feb 2017 01:12:26 +1030 Subject: [PATCH] [5.4] Allow configuration of Faker locale through config (#17895) * Allow configuration of Faker locale through config * Add en_US as default fallback locale --- src/Illuminate/Database/DatabaseServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Database/DatabaseServiceProvider.php b/src/Illuminate/Database/DatabaseServiceProvider.php index 291fc6742d47..ea78a59d178d 100755 --- a/src/Illuminate/Database/DatabaseServiceProvider.php +++ b/src/Illuminate/Database/DatabaseServiceProvider.php @@ -74,8 +74,8 @@ protected function registerConnectionServices() */ protected function registerEloquentFactory() { - $this->app->singleton(FakerGenerator::class, function () { - return FakerFactory::create(); + $this->app->singleton(FakerGenerator::class, function ($app) { + return FakerFactory::create($app['config']->get('app.faker_locale', 'en_US')); }); $this->app->singleton(EloquentFactory::class, function ($app) {