PHPackages                             matusstafura/faker-commerce - 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. matusstafura/faker-commerce

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

matusstafura/faker-commerce
===========================

A PHP lib to generate dummy data for ecommerce

v0.2.0(1w ago)21971MITPHPPHP ^8.3CI passing

Since Oct 14Pushed 1w ago1 watchersCompare

[ Source](https://github.com/matusstafura/faker-commerce)[ Packagist](https://packagist.org/packages/matusstafura/faker-commerce)[ Fund](https://www.buymeacoffee.com/matusstafura)[ GitHub Sponsors](https://github.com/matusstafura)[ RSS](/packages/matusstafura-faker-commerce/feed)WikiDiscussions main Synced 2d ago

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

PHP Faker eCommerce
===================

[](#php-faker-ecommerce)

[![PHP Composer](https://github.com/matusstafura/faker-commerce/actions/workflows/actions.yml/badge.svg)](https://github.com/matusstafura/faker-commerce/actions/workflows/actions.yml)[![Latest Version](https://camo.githubusercontent.com/63b06ad0c42213c100c1550157476a3bd7e0c6d646085b426353b31bce9e6efb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61747573737461667572612f66616b65722d636f6d6d657263652e737667)](https://packagist.org/packages/matusstafura/faker-commerce)[![PHP Version](https://camo.githubusercontent.com/d3f967bcdffa105cc08fabff9a80a410cd34dec0d9aa7a514ee2cc0c391a00c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61747573737461667572612f66616b65722d636f6d6d657263652e737667)](composer.json)[![License](https://camo.githubusercontent.com/f9e8494d47d3122b23d2808660096fcc6ff034318bd1391da4ef1983522286c3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d61747573737461667572612f66616b65722d636f6d6d657263652e737667)](LICENSE)

Generates meaningful dummy data for ecommerce use — product names, categories, prices, reviews and more — where the popular [fzaninotto/faker](https://github.com/fzaninotto/Faker)-style generators only give you generic words or lorem-ipsum text.

Requirements
------------

[](#requirements)

PHP 8.3, 8.4, or 8.5.

Install the package
-------------------

[](#install-the-package)

```
composer require matusstafura/faker-commerce
```

Usage
-----

[](#usage)

```
use FakerCommerce\Faker\FakerFactory;

// Use a factory to initialize
$faker = FakerFactory::create();

$faker->availability();
// "out of stock"

$faker->breadcrumbs(4, ">");
// "Radio>Instruments>Materials & Supplies>Accessories"

$faker->category();
// "Action Figures"

$faker->color();
// "Coral"

$faker->condition();
// "Very Good"

$faker->name();
// "Quilted Leather Jacket"

$faker->name(2);
// "Cropped Denim Jacket"

$faker->name(0);
// "Jacket" (just the product type, no descriptors)

$faker->attribute();
// "Chunky"

$faker->type();
// "Cardigan"

$faker->payment();
// "cash on delivery"

$faker->price();
// "557.00"

$faker->review();
// "Expensive for the quality."

$faker->getAllMethods();
// lists all available methods, grouped by dataset class
```

Available generators
--------------------

[](#available-generators)

MethodReturns`availability()`Stock status, e.g. `"in stock"``breadcrumbs(int $subcategories, string $separator)`A category breadcrumb trail`category()`A single product category`color()`A CSS-style color name`condition()`A listing condition, e.g. `"Like New"``name(int $attributes = 1)`A composed product name (attributes + type)`attribute()`A single material/style descriptor`type()`A single product type noun`payment()`A payment method`price(int $min, int $max, int $decimals)`A formatted price`review()`A product review sentence`getAllMethods()`Every available method, grouped by datasetExtending with your own datasets
--------------------------------

[](#extending-with-your-own-datasets)

Register a custom dataset class and its public methods become available on `$faker` too, as long as none of its method names collide with an existing one:

```
use FakerCommerce\Faker\Dataset;
use FakerCommerce\Faker\Faker;

$dataset = new Dataset();
$dataset->addDataset(MyApp\Faker\Sku::class);

$faker = new Faker($dataset->getDatasets());
$faker->sku();
```

`addDataset()` throws if the class doesn't exist, is already registered, or defines a method name that already exists in another registered dataset.

Tests
-----

[](#tests)

Run the tests with Pest PHP

```
composer test
```

License
-------

[](#license)

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

Contribution
------------

[](#contribution)

Contributions are welcome and will be fully credited. Please, add tests if required.

Support
-------

[](#support)

You can leave a star, or support ongoing development via [GitHub Sponsors](https://github.com/sponsors/matusstafura) or [Buy Me a Coffee](https://www.buymeacoffee.com/matusstafura).

Security
--------

[](#security)

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

TODO
----

[](#todo)

Please see TODO.md file.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance98

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~1387 days

Total

2

Last Release

9d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f56918987521c7c4b77e80e82275ef0ee2be4567bf65f207237f788524938f88?d=identicon)[matusstafura](/maintainers/matusstafura)

---

Top Contributors

[![matusstafura](https://avatars.githubusercontent.com/u/11353888?v=4)](https://github.com/matusstafura "matusstafura (46 commits)")

---

Tags

fakerphpfakermatusstafura

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/matusstafura-faker-commerce/health.svg)

```
[![Health](https://phpackages.com/badges/matusstafura-faker-commerce/health.svg)](https://phpackages.com/packages/matusstafura-faker-commerce)
```

###  Alternatives

[fakerphp/faker

Faker is a PHP library that generates fake data for you.

4.0k401.1M5.1k](/packages/fakerphp-faker)[mbezhanov/faker-provider-collection

A collection of custom providers for the Faker library

2169.8M26](/packages/mbezhanov-faker-provider-collection)[pragmarx/random

Create random chars, numbers, strings

704.7M5](/packages/pragmarx-random)[pelmered/fake-car

Fake-Car is a Faker provider that generates fake car data for you.

1261.4M2](/packages/pelmered-fake-car)[bheller/images-generator

Generator of placeholder images for Faker

573.1M3](/packages/bheller-images-generator)[xefi/faker-php

Faker allows you to generate realistic fake data for your php applications

18824.5k16](/packages/xefi-faker-php)

PHPackages © 2026

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