PHPackages                             bambamboole/extended-faker - 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. bambamboole/extended-faker

ActiveLibrary

bambamboole/extended-faker
==========================

0.3.0(5mo ago)037.0k↓18.5%MITPHPPHP &gt;=8.2.0CI passing

Since Sep 20Pushed 5mo agoCompare

[ Source](https://github.com/bambamboole/extended-faker)[ Packagist](https://packagist.org/packages/bambamboole/extended-faker)[ RSS](/packages/bambamboole-extended-faker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (7)Used By (0)

Extended Faker
==============

[](#extended-faker)

PHP package extending [FakerPHP/Faker](https://github.com/FakerPHP/Faker) with realistic product, category, and blog post data. Provides 25+ products, 19+ categories, and **dynamically generates 1000+ unique blog posts** with localized content across English (en\_US) and German (de\_DE).

Features
--------

[](#features)

- **Cross-language consistency**: Same identifiers across locales with localized content
- **Multiple data types**: Products, categories, and blog posts
- **Dynamic blog post generation**: Compositional template system generates 1000+ unique blog posts
- **Markdown blog posts**: Professional content with headings, code blocks, and rich formatting
- **Realistic data**: Actual product names, descriptions, categories, and dynamically composed articles
- **Deterministic generation**: Same seed produces same blog post for reproducible testing
- **Extensible**: Easy to add new data via JSON template files

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

[](#installation)

```
composer require bambamboole/extended-faker
```

Usage
-----

[](#usage)

### Basic Product Data

[](#basic-product-data)

```
use Faker\Factory;
use Bambamboole\ExtendedFaker\Providers\en_US\Product;

$faker = Factory::create('en_US');
$faker->addProvider(new Product($faker));

// Random product
$product = $faker->product();
// ['name' => 'Samsung Galaxy S24 Ultra 5G', 'sku' => 'PHONE-001', ...]

// Specific product methods
$name = $faker->productName();           // "iPhone 15 Pro Max"
$description = $faker->productDescription(); // Full product description
$category = $faker->productCategory();   // "Cell Phones & Smartphones"
```

### Cross-Language Support

[](#cross-language-support)

```
use Bambamboole\ExtendedFaker\Providers\de_DE\Product as GermanProduct;

// English version
$englishProduct = $faker->productBySku('PHONE-001', 'en_US');
// ['name' => 'Samsung Galaxy S24 Ultra 5G', 'sku' => 'PHONE-001', ...]

// German version (same SKU, localized content)
$germanProduct = $faker->productBySku('PHONE-001', 'de_DE');
// ['name' => 'Samsung Galaxy S24 Ultra', 'sku' => 'PHONE-001', ...]
```

### Categories

[](#categories)

```
use Bambamboole\ExtendedFaker\Providers\en_US\Category;

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

$category = $faker->category();          // Random category
$categoryName = $faker->categoryName();  // "Electronics"
```

### Blog Posts

[](#blog-posts)

```
use Bambamboole\ExtendedFaker\Providers\en_US\BlogPost;

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

// Random blog post (dynamically generated)
$post = $faker->blogPost();
// BlogPostDto with title, content, excerpt, tags, author, etc.

// Specific blog post methods
$title = $faker->blogPostTitle();        // "Getting Started with Docker in 2024"
$content = $faker->blogPostContent();    // Full markdown content
$excerpt = $faker->blogPostExcerpt();    // Short summary
$tags = $faker->blogPostTags();          // ["docker", "devops", "containers"]
$author = $faker->blogPostAuthor();      // "Michael Chen"
$category = $faker->blogPostCategory();  // "technology"
$readingTime = $faker->blogPostReadingTime(); // 2 (minutes)

// Get post by dynamically generated slug
$slug = $post->slug;
$retrievedPost = $faker->blogPostBySlug($slug);

// Cross-locale blog posts work with any generated slug
$enPost = $faker->blogPost();
$dePost = $faker->getBlogPostInLocale($enPost->slug, 'de_DE');
```

### Using ExtendedFaker Helper

[](#using-extendedfaker-helper)

For convenience, use the `ExtendedFaker::extend()` method to register all providers at once:

```
use Faker\Factory;
use Bambamboole\ExtendedFaker\ExtendedFaker;

// Automatically registers Product, Category, and BlogPost providers
$faker = Factory::create('en_US');
ExtendedFaker::extend($faker, 'en_US');

// Now use any provider
$product = $faker->product();
$category = $faker->category();
$blogPost = $faker->blogPost();

// German locale
$fakerDe = Factory::create('de_DE');
ExtendedFaker::extend($fakerDe, 'de_DE');
```

Available Methods
-----------------

[](#available-methods)

### Product Provider

[](#product-provider)

- `productName(?string $identifier = null): string`
- `productDescription(?string $identifier = null): string`
- `productCategory(?string $identifier = null): string`
- `product(?string $identifier = null): array`
- `productBySku(string $sku, ?string $locale = null): array`
- `getProductSku(string $name): string`
- `getProductInLocale(string $sku, string $locale): array`

### Category Provider

[](#category-provider)

- `categoryName(?string $identifier = null): string`
- `category(?string $identifier = null): array`

### BlogPost Provider

[](#blogpost-provider)

- `blogPostTitle(?string $identifier = null): string`
- `blogPostContent(?string $identifier = null): string`
- `blogPostExcerpt(?string $identifier = null): string`
- `blogPostCategory(?string $identifier = null): string`
- `blogPostTags(?string $identifier = null): array`
- `blogPostAuthor(?string $identifier = null): string`
- `blogPostReadingTime(?string $identifier = null): int`
- `blogPost(?string $identifier = null): BlogPostDto`
- `blogPostBySlug(string $slug, ?string $locale = null): BlogPostDto`
- `getBlogPostSlug(string $title): string`
- `getBlogPostInLocale(string $slug, string $locale): BlogPostDto`

Data Structure
--------------

[](#data-structure)

Products and categories are stored as JSON files, while blog posts are dynamically generated from composable templates:

```
resources/
├── products/
│   ├── samsung-galaxy-s24.json
│   ├── iphone-15.json
│   └── ...
├── categories/
│   ├── cell-phones-smartphones.json
│   ├── electronics.json
│   └── ...
└── blog-templates/
    ├── titles.json              // Title patterns by category
    ├── introductions.json       // Opening paragraph templates
    ├── sections.json            // Body content blocks by category
    ├── conclusions.json         // Closing paragraph templates
    ├── code-examples.json       // Code snippets for tech posts
    └── metadata.json            // Authors, tags, topics, dates

```

### Blog Post Generation

[](#blog-post-generation)

Blog posts are **dynamically generated** using a compositional template system that mixes and matches components:

- **1000+ unique combinations** from template patterns
- **Deterministic generation**: Same seed always produces the same post
- **Category-specific content**: Technology, Business, Travel, Lifestyle
- **Automatic slug generation** from titles
- **Reading time calculation** based on word count (200 words/minute)
- **3-5 minute reads**: Short, focused blog posts (150-350 words)

**Available Categories:** Technology, Business, Travel, Lifestyle

Each generated post includes:

- Unique title and slug
- Category-appropriate introduction
- 4-5 content sections
- Conclusion
- 3-5 relevant tags
- Random author name
- Published date (2023-2024)
- Calculated reading time
- Optional code examples (technology posts)

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

[](#requirements)

- PHP 8.2+
- fakerphp/faker ^1.24
- league/commonmark ^2.7
- symfony/yaml ^7.3

Testing
-------

[](#testing)

```
composer install
./vendor/bin/pest
```

License
-------

[](#license)

MIT License

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity30

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

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

Total

4

Last Release

171d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/547137a6d80cad01ed1dd065b1c6af329d9a23a4134a895cff01e078cc155500?d=identicon)[bambamboole](/maintainers/bambamboole)

---

Top Contributors

[![bambamboole](https://avatars.githubusercontent.com/u/8823695?v=4)](https://github.com/bambamboole "bambamboole (17 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bambamboole-extended-faker/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k12.2M45](/packages/knuckleswtf-scribe)[tightenco/jigsaw

Simple static sites with Laravel's Blade.

2.2k438.5k29](/packages/tightenco-jigsaw)[jason-munro/cypht

Lightweight Open Source webmail written in PHP and JavaScript

1.5k146.0k](/packages/jason-munro-cypht)

PHPackages © 2026

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