PHPackages                             titustum/kenyan-faker-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. titustum/kenyan-faker-provider

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

titustum/kenyan-faker-provider
==============================

Kenyan-specific Faker provider for Laravel and PHP Faker

v1.1.1(2mo ago)252MITPHP

Since Sep 14Pushed 2mo agoCompare

[ Source](https://github.com/titustum/kenyan-faker-provider)[ Packagist](https://packagist.org/packages/titustum/kenyan-faker-provider)[ RSS](/packages/titustum-kenyan-faker-provider/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

Kenyan Faker Provider 🇰🇪
========================

[](#kenyan-faker-provider-)

Kenyan-specific locale data for [Faker](https://github.com/FakerPHP/Faker), designed for PHP applications and Laravel projects.

Once installed, **`fake()` and `$this->faker` automatically generate Kenyan data** — no manual setup required.

> 📦 Package: `titustum/kenyan-faker-provider`🇰🇪 Locale: `en_KE`

Supported data:

- Person names (Christian &amp; Islamic names)
- Phone numbers (Safaricom, Airtel, Telkom)
- Counties, Towns &amp; Cities
- Addresses &amp; Postal Codes
- Companies
- MPESA Payments (Paybill &amp; Till)
- Kenyan Internet data (emails, domains, usernames)

---

📦 Installation
--------------

[](#-installation)

```
composer require titustum/kenyan-faker-provider --dev
```

That's it. Laravel auto-discovers the package and registers the `KenyanFakerServiceProvider` automatically. No changes to `config/app.php` needed.

> **Note:** If you have a cached config, run `php artisan config:clear` and `php artisan package:discover` after installing.

---

🚀 Usage
-------

[](#-usage)

### In Laravel — Zero Configuration

[](#in-laravel--zero-configuration)

After installation, `fake()` and `$this->faker` are already Kenyan. Use them anywhere:

```
// In a Factory
public function definition(): array
{
    return [
        'name'    => fake()->name(),           // "Mary Wanjiku"
        'email'   => fake()->email(),          // "mary.wanjiku@kenya.co.ke"
        'phone'   => fake()->phoneNumber(),    // "0722 654 321"
        'county'  => fake()->county(),         // "Kiambu"
        'town'    => fake()->town(),           // "Thika"
        'address' => fake()->address(),        // "Thika, Kiambu 01000"
        'company' => fake()->company(),        // "Rift Valley Traders Ltd"
    ];
}
```

```
// In a Seeder
class UsersTableSeeder extends Seeder
{
    public function run(): void
    {
        DB::table('users')->insert([
            'name'       => $this->faker->name(),
            'email'      => $this->faker->email(),
            'phone'      => $this->faker->phoneNumber(),
            'county'     => $this->faker->county(),
            'mpesa_till' => $this->faker->mpesaTill(),   // "923456"
        ]);
    }
}
```

### Outside Laravel (Plain PHP)

[](#outside-laravel-plain-php)

```
use Faker\Factory;
use KenyaFaker\Provider\en_KE\Person;
use KenyaFaker\Provider\en_KE\PhoneNumber;
use KenyaFaker\Provider\en_KE\Address;
use KenyaFaker\Provider\en_KE\Company;
use KenyaFaker\Provider\en_KE\Payment;
use KenyaFaker\Provider\en_KE\Internet;

$faker = Factory::create('en_KE');

$faker->addProvider(new Person($faker));
$faker->addProvider(new PhoneNumber($faker));
$faker->addProvider(new Address($faker));
$faker->addProvider(new Company($faker));
$faker->addProvider(new Payment($faker));
$faker->addProvider(new Internet($faker));

echo $faker->name();         // "Brian Kiptoo"
echo $faker->county();       // "Uasin Gishu"
echo $faker->phoneNumber();  // "0733 123 456"
```

---

🧩 Available Providers
---------------------

[](#-available-providers)

### Person

[](#person)

```
fake()->name();            // "Mary Wanjiku"
fake()->name('male');      // "James Kiprotich"
fake()->name('female');    // "Amina Akinyi"
fake()->firstName();       // "Amina"
fake()->lastName();        // "Mutua"
```

### Phone Number

[](#phone-number)

```
fake()->phoneNumber();     // "0722 654 321"
fake()->mobileNumber();    // "0798 123 456"
```

### Address

[](#address)

```
fake()->county();          // "Kiambu"
fake()->town();            // "Thika"
fake()->city();            // "Garissa"
fake()->postalCode();      // "01000"
fake()->address();         // "Thika, Kiambu 01000"
```

### Company

[](#company)

```
fake()->company();         // "Rift Valley Traders Ltd"
fake()->companySuffix();   // "Enterprises"
```

### Payment (MPESA)

[](#payment-mpesa)

```
fake()->mpesaPaybill();    // "345678"
fake()->mpesaTill();       // "923456"
```

### Internet

[](#internet)

```
fake()->email();           // "kevin.kiprotich@kenya.co.ke"
fake()->domainName();      // "nairobitech.co.ke"
fake()->userName();        // "wanjiku.m"
```

---

⚙️ How Auto-Discovery Works
---------------------------

[](#️-how-auto-discovery-works)

When you install the package, Laravel auto-discovers `KenyanFakerServiceProvider` via the `extra.laravel` key in `composer.json`. The service provider:

1. Sets the app's faker locale to `en_KE`
2. Rebinds the `Faker\Generator` singleton with all Kenyan providers pre-loaded
3. Ensures both `fake()` and `$this->faker` point to the same Kenyan instance

This means **you never need to call `Faker::create('en_KE')` or `addProvider()` manually** in a Laravel project.

---

🛠 Features
----------

[](#-features)

ProviderStatusDescription`Person.php`✅ ReadyKenyan male/female first &amp; last names`PhoneNumber.php`✅ ReadyKenyan mobile numbers (Safaricom, Airtel, Telkom)`Address.php`✅ ReadyCounties, towns, postal codes`Company.php`✅ ReadyLocal business names and suffixes`Payment.php`✅ ReadyMPESA Paybill &amp; Till numbers`Internet.php`✅ ReadyKenyan emails, domains, usernames---

🛠 Local Development Setup
-------------------------

[](#-local-development-setup)

To test locally inside another Laravel app:

1. Clone this repo:

    ```
    git clone https://github.com/titustum/kenyan-faker-provider.git
    ```
2. In your Laravel app's `composer.json`, add a path repository:

    ```
    "repositories": [
      {
        "type": "path",
        "url": "../path-to/kenyan-faker-provider"
      }
    ]
    ```
3. Require the package:

    ```
    composer require titustum/kenyan-faker-provider --dev
    ```
4. Clear caches:

    ```
    php artisan package:discover
    php artisan config:clear
    ```

---

🌍 Roadmap
---------

[](#-roadmap)

- Person names (Christian, Muslim, regional)
- Phone numbers (Safaricom, Airtel, Telkom)
- Address data (Counties, Towns, P.O. Boxes)
- Company data
- Payment providers (MPESA Paybill &amp; Till)
- Internet data (emails, domains)
- Laravel auto-discovery (zero-config setup)
- Regional/tribal name sets
- Sub-county and ward level address data
- Airtel Money &amp; T-Kash payment numbers

---

🙌 Contributing
--------------

[](#-contributing)

Pull requests are welcome! Feel free to submit bug fixes, new providers, or improved datasets. Please open an issue first for major changes.

---

✍️ Author
---------

[](#️-author)

**Titus Tum**📧 🔗 [GitHub: @titustum](https://github.com/titustum)

---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

⭐️ Why Use This?
----------------

[](#️-why-use-this)

Laravel projects targeting Kenya often lack realistic seed data. This package brings localized names, phone numbers, addresses, and business data — and unlike generic Faker, it works out of the box with zero configuration. Install it once, and every `fake()` call in your app speaks Kenyan.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance86

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~56 days

Total

6

Last Release

72d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36922214?v=4)[TITUS KIPTANUI](/maintainers/titustum)[@titustum](https://github.com/titustum)

---

Top Contributors

[![titustum](https://avatars.githubusercontent.com/u/36922214?v=4)](https://github.com/titustum "titustum (14 commits)")

---

Tags

fakerfakerphpkenyan-faker

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/titustum-kenyan-faker-provider/health.svg)

```
[![Health](https://phpackages.com/badges/titustum-kenyan-faker-provider/health.svg)](https://phpackages.com/packages/titustum-kenyan-faker-provider)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k19](/packages/solspace-craft-freeform)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.4k](/packages/blair2004-nexopos)[directorytree/dummy

439.9k](/packages/directorytree-dummy)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
