Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Allow configuration of Faker locale through config #17895

Merged
merged 2 commits into from
Feb 12, 2017

Conversation

dwightwatson
Copy link
Contributor

As a followup to #17887, this grabs an adjustment to the Faker locale through the configuration. I went with env the first time as I thought it wouldn't matter much in development/test environments.

Here I'm using app.faker_locale as I'm not sure if any of the other standard configuration files are a better fit for this setting. Let me know if you would prefer a different name/location.

I'm happy to make the PR to laravel/laravel if this gets merged and you want it in the app boilerplate.

@tillkruss tillkruss changed the title Allow configuration of Faker locale through config [5.4] Allow configuration of Faker locale through config Feb 12, 2017
@soprun
Copy link

soprun commented Feb 12, 2017

But why create a new config, if you can do it yourself? example

@dwightwatson
Copy link
Contributor Author

Because it's easier than making people override the singleton registration themselves, and as per the internals discussion there's at least a bit of interest in it.

@soprun
Copy link

soprun commented Feb 12, 2017

Well, in general, I like the idea.
It was necessary for each project to add the provider registration.

@taylorotwell taylorotwell merged commit cf9822a into laravel:5.4 Feb 12, 2017
@garygreen
Copy link
Contributor

garygreen commented Feb 13, 2017

Thanks for this @dwightwatson @taylorotwell , makes it much more convenient! May even encourage people to use faker with seeders more, as I have started doing 😄

clemblanco added a commit to clemblanco/laravel-laravel that referenced this pull request Oct 2, 2018
As per [that PR](laravel/framework#17895) and [the documentation](https://laravel.com/docs/5.6/database-testing#writing-factories), I wanted to make sure this was present in the `app/config.php` out of the box.

It's a great thing and I'm sure people will be happy to use it rather than overriding the singleton registration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants