Faker locale can be configured in the config/app.php configuration file. Just add the key faker_locale.

e.g.: 'faker_locale' => 'fr_FR',

See also my PR to document that previously undocumented feature: https://github.com/laravel/laravel/pull/4161

Answer from Vincent Mimoun-Prat on Stack Overflow
🌐
GitHub
github.com › laravel › ideas › issues › 398
Make it easier to change the locale of Faker · Issue #398 · laravel/ideas
January 31, 2017 - At the moment Faker always defaults the locale to US. It would be nice if there was some kind of way of changing it through a config/env option. I know you can change it by completely overriding the way the faker generator singleton is r...
Author   garygreen
🌐
Laravel
laravel.com › docs › 7.x › database-testing
Database Testing | Laravel 7.x - The clean stack for Artisans and agents
You can set the Faker locale by adding a faker_locale option to your config/app.php configuration file.
🌐
FakerPHP
fakerphp.org
FakerPHP / Faker
If no localized provider is found, the factory falls back to the default locale (en_US). // create a French faker $faker = Faker\Factory::create('fr_FR'); for ($i = 0; $i < 3; $i++) { echo $faker->name() .
🌐
Welcm Learning
welcm.uk › blog › getting-started-with-faker-in-laravel
Getting Started With Faker in Laravel | Welcm Learning. Blog
We can create localised fake data simply by specifying the locale when creating the Faker, for example: ... Since Laravel 5.2 the locale can also be configured in your /config/app.php file, find the faker_locale section and update, for example:
🌐
Awssat
awssat.com › blog › How-to-make-faker-uses-multiple-locales-with-Laravel-model-factories
How to make faker uses multiple locales with Laravel model factories — Awssat
May 4, 2022 - 'ar_SA' : 'en_US'); return [ 'language' => $lang, 'title' => $this->faker->realTextBetween(40, 70), 'content' => $this->faker->realTextBetween(500, 750), ]; } } And voilà, it works for now. ... Building robust web apps, contributing to open source, and sharing Laravel expertise.
🌐
GitHub
github.com › saberfazliahmadi › Laravel-Tips › blob › main › tips › 010-customizing-faker-locale-for-authentic-dummy-data.md
Laravel-Tips/tips/010-customizing-faker-locale-for-authentic-dummy-data.md at main · saberfazliahmadi/Laravel-Tips
Generating realistic dummy data is essential for testing, seeding, and showcasing your Laravel applications. By default, Faker uses the en_US locale, which might not represent the diversity of your user base.
Author   saberfazliahmadi
Find elsewhere
🌐
Faker
faker.readthedocs.io › en › master › locales › fa_IR.html
Locale fa_IR — Faker 40.11.0 documentation
class faker.providers.bank.fa_IR.Provider(generator: Any)¶ ... Implement bank provider for fa_IR locale.
🌐
GitHub
github.com › laravel › framework › issues › 28410
Faker neglects locale set in the config · Issue #28410 · laravel/framework
May 3, 2019 - The default Laravel installation sets the Faker's locale to 'en_US' in the config/app.php file, but Faker still uses, I believe, Latin (as Google Translator detected).
Author   andriihorpenko
🌐
GitHub
github.com › laravel › framework › issues › 30345
Faker locale configuration does not work. · Issue #30345 · laravel/framework
October 19, 2019 - Laravel Version: 5.8.35 PHP Version: 7.2.19 Database Driver & Version: psql (PostgreSQL) 11.5 The locale configuration for faker in config > app.php does not work. Steps To Reproduce: Set the locale to config > app.php Create a model fac...
Author   cristian-home
🌐
Gdebrauwer
gdebrauwer.dev › blog › how-to-customize-php-faker-in-laravel
How to customize PHP Faker in Laravel | Günther Debrauwer
August 19, 2023 - You can even take it a step further ... to faker’s optional() and unique() methods. In the projects at work, we use spatie/laravel-translable package to save translations in json columns. That means in a lot of tests and model factories, we have to manually create an array with locales as ...
🌐
Laracasts
laracasts.com › discuss › channels › testing › factories-localization
Factories localization
August 12, 2015 - We cannot provide a description for this page right now
🌐
GitHub
github.com › fzaninotto › Faker
GitHub - fzaninotto/Faker: Faker is a PHP library that generates fake data for you · GitHub
You can check available Faker locales in the source code, under the Provider directory. The localization of Faker is an ongoing process, for which we need your help.
Starred by 26.7K users
Forked by 3.6K users
Languages   PHP
🌐
FakerPHP
fakerphp.org › formatters
FakerPHP / Faker - Available Formatters
In all examples, a Faker instance is made using the en_US default locale.
🌐
Faker
faker.readthedocs.io › en › master › locales › en_PH.html
Locale en_PH — Faker 40.11.1 documentation
Both languages are used in this locale for this purpose. All the english_* methods use their corresponding standard lorem provider method under the hood with ext_word_list set to the EnUsLoremProvider’s word list. english_paragraph(nb_sentences: int = 3, variable_nb_sentences: bool = True) → str¶ · Generate a paragraph in English. ... >>> Faker.seed(0) >>> for _ in range(5): ...
🌐
GitHub
github.com › laravel › laravel › pull › 4161
Faker locale can be set in config, add that to the default config files by vpratfr · Pull Request #4161 · laravel/laravel
At some point in time, Laravel allowed to change the locale used by Faker. However that configuration variable has remained undocumented and people are probably still doing it with a custom provide...
Author   laravel
🌐
Faker
faker.readthedocs.io › en › master › locales › ru_RU.html
Locale ru_RU — Faker 40.13.0 documentation
If use_dataset is True, this method ... on those locale-specific codes if included. If those codes were not included, then it will behave as if use_dataset were False, and in that mode, all those codes will just be randomly generated as per the specification. ... >>> Faker.seed(0) >>> ...