geekish/faker-providers

Extra providers for Faker

Maintainers

Package info

github.com/geekish/faker-providers

pkg:composer/geekish/faker-providers

Fund package maintenance!

geekish

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-05-20 17:48 UTC

This package is auto-updated.

Last update: 2026-05-20 18:06:10 UTC


README

Latest Version on Packagist Tests Total Downloads

Adds some extra providers to fakerphp/faker. Some are ported/adapted from the original and mbezhanov/faker-provider-collection.

Installation

You can install the package via composer:

composer require geekish/faker-providers

Usage

To register all providers:

use Faker\Generator;

$faker = new Faker\Generator();

FakerProviders::register($faker);

In Laravel, adding providers to the Faker instance accessible via fake() can be done like so:

use Faker\Generator;
use Geekish\FakerProviders\FakerProviders;
use Illuminate\Foundation\Application;

$locale = $this->app->get('config')->get('app.faker_locale', 'en_US');
$abstract = Generator::class.':'.$locale;

$this->app->resolving($abstract, function (Generator $faker, Application $app) {
    FakerProviders::register($faker);

    return $faker;
});

Of course, you are free to register the providers individually:

use Faker\Generator;
use Geekish\FakerProviders\Arts\Literature;

$faker = new Faker\Generator();

$faker->addProvider(new Literature($faker));

$faker->bookTitle();

Providers

  • Literature
    • author
    • genre
    • bookTitle
    • bookSeries
  • Horse
    • horseBreed
  • Music
    • musicalGenre
    • instrument
    • band
    • femaleMusician
    • maleMusician
    • musician (generates any of the previous three)
  • StarWars
    • starWarsCharacter
    • starWarsDroid
    • starWarsPlanet
    • starWarsSpecies
    • starWarsVehicle
  • Space
    • constellation
    • cluster
    • dwarfPlanet
    • galaxy
    • planet
    • moon
    • nebula
    • star

Testing

Each provider should be covered.

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.