Skip to content

Commit

Permalink
[5.4] Allow configuration of Faker locale through config (#17895)
Browse files Browse the repository at this point in the history
* Allow configuration of Faker locale through config

* Add en_US as default fallback locale
  • Loading branch information
dwightwatson authored and taylorotwell committed Feb 12, 2017
1 parent 341b7b6 commit cf9822a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Database/DatabaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cf9822a

Please sign in to comment.