PHPackages                             chinleung/laravel-faker-providers - 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. chinleung/laravel-faker-providers

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

chinleung/laravel-faker-providers
=================================

Custom collection of Laravel Faker providers.

v4.0.0(2y ago)012.2k↓35.7%MITPHPPHP ^8.2CI failing

Since Jul 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/chinleung/laravel-faker-providers)[ Packagist](https://packagist.org/packages/chinleung/laravel-faker-providers)[ Docs](https://github.com/chinleung/laravel-faker-providers)[ RSS](/packages/chinleung-laravel-faker-providers/feed)WikiDiscussions v4 Synced 2d ago

READMEChangelog (10)Dependencies (4)Versions (16)Used By (0)

Laravel Faker Providers
=======================

[](#laravel-faker-providers)

[![Latest Version on Packagist](https://camo.githubusercontent.com/66f4e7d49b847f083cb13a49f1f98beda183247e12490cc418de2b8b1291e92e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696e6c65756e672f6c61726176656c2d66616b65722d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chinleung/laravel-faker-providers)[![Build Status](https://camo.githubusercontent.com/adf07d9f646b18d477319f5110814ebf1bd700ee6162f446e9dc858cc0fbd53d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6368696e6c65756e672f6c61726176656c2d66616b65722d70726f7669646572732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/chinleung/laravel-faker-providers)[![Quality Score](https://camo.githubusercontent.com/0f57b9a8465fa32e2fa53e7d8faac8f18d608549850d9b3770f2631d7eeb9624/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6368696e6c65756e672f6c61726176656c2d66616b65722d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/chinleung/laravel-faker-providers)[![Total Downloads](https://camo.githubusercontent.com/c6134e98c0115b2e1b402795cd290699dbeb77fa8094a9e0305ca2f20e8577c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368696e6c65756e672f6c61726176656c2d66616b65722d70726f7669646572732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chinleung/laravel-faker-providers)

A collection of extra [Faker](https://github.com/fzaninotto/Faker) providers.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require chinleung/laravel-faker-providers --dev
```

Providers
---------

[](#providers)

BooleanOptionalModifierProvider### Note

[](#note)

This is a provider that adds support for true and false values Faker's default optional modifier.

TranslatableAttributeProvider### Note

[](#note-1)

This is a provider for JSON columns of [Spatie's Laravel Translatable](https://github.com/spatie/laravel-translatable) package.

### Methods

[](#methods)

- [translatable](#translatableclosure-callable-array-locales--null--array)
- [translatableName](#translatablenamearray-locales--null--array)

### translatable(\\Closure $callable, array $locales = null) : array

[](#translatableclosure-callable-array-locales--null--array)

*Pass a closure to be executed for every locale.*

Example```
$faker->translatable(function () use ($faker) {
  return strtolower($faker->word);
});
```

**Output**

```
['en' => 'laravel', 'fr' => 'php']
```

### translatableName(array $locales = null) : array

[](#translatablenamearray-locales--null--array)

*Generate a name for every locale.*

Example```
$faker->translatableName;
```

**Output**

```
['en' => 'John Doe', 'fr' => 'Jane Doe']
```

Usage
-----

[](#usage)

Add the provider that you need to your `Faker\Generator` instance and simply use a method of the provider:

```
factory(User::class, function (Faker $faker) {
    $faker->addProvider(new \ChinLeung\LaravelFakerProviders\TranslatableAttributeProvider($faker));

    return [
        'name' => $faker->translatableName, // ['en' => 'John Doe', 'fr' => 'Jane Doe']
    ];
});
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chin Leung](https://github.com/chinleung)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~117 days

Recently: every ~204 days

Total

16

Last Release

767d ago

Major Versions

v1.x-dev → v2.0.02022-03-03

v2.x-dev → v3.0.02023-06-27

v3.x-dev → v4.0.02024-05-28

PHP version history (6 changes)v1.0.0PHP ^7.1

v1.2.1PHP ^7.2

v1.3.0PHP ^7.3

v2.0.0PHP ^8.0

v3.0.0PHP ^8.1

v4.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/40590fe8b8c82dfac2530c6f0c0c39dd1dded4c3ad136e15ef2cf3bb20304dad?d=identicon)[ChinLeung](/maintainers/ChinLeung)

---

Top Contributors

[![chinleung](https://avatars.githubusercontent.com/u/19669331?v=4)](https://github.com/chinleung "chinleung (25 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

collectioncomposer-packagefakerlaravelpackagephpchinleunglaravel-faker-providers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chinleung-laravel-faker-providers/health.svg)

```
[![Health](https://phpackages.com/badges/chinleung-laravel-faker-providers/health.svg)](https://phpackages.com/packages/chinleung-laravel-faker-providers)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M376](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

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