Change Faker Locale in Laravel 5.2

Is there a way to specify the Faker locale in the database/factories/ModelFactory.php file ? Here is my non functioning attempt at doing so >,<

$factory->define(AppFlyer::class, function (FakerGenerator $faker) {

    // What is the correct way of doing this?

    return [
        'zip' => $faker->postcode,
        'state' => $faker->state,  

Thanks for reading!


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: