PHPackages                             aerni/statamic-factory - 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. aerni/statamic-factory

Abandoned → [aerni/factory](/?search=aerni%2Ffactory)Library[Utility &amp; Helpers](/categories/utility)

aerni/statamic-factory
======================

Quickly whip up fake content

v1.5.1(1y ago)194474[1 issues](https://github.com/aerni/statamic-factory/issues)[1 PRs](https://github.com/aerni/statamic-factory/pulls)MITPHPPHP ^8.1CI failing

Since Aug 28Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/aerni/statamic-factory)[ Packagist](https://packagist.org/packages/aerni/statamic-factory)[ Docs](https://github.com/aerni/statamic-factory)[ RSS](/packages/aerni-statamic-factory/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

[![Statamic](https://camo.githubusercontent.com/ed84414a56c4103f1be80b0aef8a041422eeac40e3785ea1bd10076723566c7b/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f342e302b2f464632363945)](https://camo.githubusercontent.com/ed84414a56c4103f1be80b0aef8a041422eeac40e3785ea1bd10076723566c7b/68747470733a2f2f666c61742e62616467656e2e6e65742f62616467652f53746174616d69632f342e302b2f464632363945) [![Packagist version](https://camo.githubusercontent.com/25c26e7b363165289159935cbeef618f2f42d1f345b982a372c663d3bb2fb530/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f6165726e692f666163746f72792f6c6174657374)](https://camo.githubusercontent.com/25c26e7b363165289159935cbeef618f2f42d1f345b982a372c663d3bb2fb530/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f762f6165726e692f666163746f72792f6c6174657374) [![Packagist Total Downloads](https://camo.githubusercontent.com/92450a227a220427ecf108062bc0c28ea9365ce63aebe12f01b6d27153f19320/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f6165726e692f666163746f7279)](https://camo.githubusercontent.com/92450a227a220427ecf108062bc0c28ea9365ce63aebe12f01b6d27153f19320/68747470733a2f2f666c61742e62616467656e2e6e65742f7061636b61676973742f64742f6165726e692f666163746f7279)

Factory
=======

[](#factory)

This addon provides an easy way to quickly whip up fake data for your `Collection Entries`, `Taxonomy Terms` and `Globals` using [Faker](https://github.com/FakerPHP/Faker).

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

[](#installation)

Install the addon using Composer:

```
composer require aerni/factory
```

Publish the config of the package:

```
php please vendor:publish --tag=factory-config
```

The following config will be published to `config/factory.php`:

```
return [

    /*
    |--------------------------------------------------------------------------
    | Publish Status
    |--------------------------------------------------------------------------
    |
    | The publish status of collection entries and taxonomy terms
    | created by the factory.
    |
    | Tip: Randomize the status by setting this to '(bool) random_int(0, 1)'.
    |
    */

    'published' => true,

    /*
    |--------------------------------------------------------------------------
    | Title Fallback Settings
    |--------------------------------------------------------------------------
    |
    | These title settings will function as a fallback to create titles for
    | your collection entries and taxonomy terms, if you didn't explicitly set
    | a 'title' field in the respective blueprint.
    |
    | 'chars': The character count of the title will be in this range.
    | 'real_text': Use real english words instead of Lorem Ipsum.
    |
    */

    'title' => [
        'chars' => [$min = 20, $max = 30],
        'real_text' => true,
    ],

];
```

Basic Usage
-----------

[](#basic-usage)

Before you go crazy whipping up fake goodies, you need to let the Factory know what fields you want it to create. You do so by defining a `factory` key on each field in your blueprint that you want to fake. The value of the key is a Faker formatter for simple fieldtypes and an array of options for advanced fieldtypes like a grid. Please consult the [Faker Documentation](https://github.com/FakerPHP/Faker) for available formatters.

This is an example blueprint for a collection of people:

```
title: Person
sections:
  main:
    display: Main
    fields:
      -
        handle: first_name
        field:
          type: text
          factory: firstName
      -
        handle: last_name
        field:
          type: text
          factory: lastName
      -
        handle: age
        field:
          type: number
          factory: numberBetween(20, 50)
      -
        handle: bio
        field:
          type: textarea
          factory: paragraph(3, true)
```

Run the factory in your terminal and follow the instructions:

```
php please factory
```

Special Fieldtypes
------------------

[](#special-fieldtypes)

The above example works great for basic fieldtypes. But what about Bard, Replicator, Grid and Tables? I'm glad you asked. To fake content for these "Special Fieldtypes" you need to change the blueprint according to the examples below.

### Bard &amp; Replicator

[](#bard--replicator)

`min_sets` defines the minimum number of sets to create. `max_sets` defines the maximum number of sets to create.

```
title: 'Bard & Replicator'
sections:
  main:
    display: Main
    fields:
      -
        handle: replicator
        field:
          type: replicator
          sets:
            text:
              display: Text
              factory:
                min_sets: 1
                max_sets: 3
              fields:
                -
                  handle: text
                  field:
                    type: text
                    factory: word
                -
                  handle: textarea
                  field:
                    type: textarea
                    factory: 'paragraph(3, true)'
```

### Grid

[](#grid)

`min_rows` defines the minimum number of rows to create. `max_rows` defines the maximum number of rows to create.

```
title: Table
sections:
  main:
    display: Main
    fields:
      -
        handle: grid
        field:
          type: grid
          factory:
            min_rows: 1
            max_rows: 4
          fields:
            -
              handle: first_name
              field:
                type: text
                factory: firstName
            -
              handle: last_name
              field:
                type: text
                factory: lastName
```

### Table

[](#table)

`min_rows` defines the minimum number of rows you want to create. `max_rows` defines the maximum number of rows you want to create. `min_cells` defines the minimum number of cells you want to create. `max_cells` defines the maximum number of cells you want to create. `formatter` defines the faker formatter to use.

```
title: Table
sections:
  main:
    display: Main
    fields:
      -
        handle: table
        field:
          type: table
          factory:
            min_rows: 1
            max_rows: 3
            min_cells: 3
            max_cells: 5
            formatter: word
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance55

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~206 days

Recently: every ~268 days

Total

8

Last Release

635d ago

PHP version history (5 changes)v1.0.0PHP ^7.4

v1.1.1PHP ^7.4|^8.0

v1.2.0PHP ^7.4 || ^8.0

v1.4.0PHP ^8.0

v1.5.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f0a168dc347e5e141dc13cec734d3b0a25a13445069483732580f26f71456a6?d=identicon)[aerni](/maintainers/aerni)

---

Top Contributors

[![aerni](https://avatars.githubusercontent.com/u/23167701?v=4)](https://github.com/aerni "aerni (102 commits)")[![innoscience](https://avatars.githubusercontent.com/u/6894281?v=4)](https://github.com/innoscience "innoscience (1 commits)")[![johncarter-](https://avatars.githubusercontent.com/u/3776888?v=4)](https://github.com/johncarter- "johncarter- (1 commits)")[![joshuablum](https://avatars.githubusercontent.com/u/3824203?v=4)](https://github.com/joshuablum "joshuablum (1 commits)")

---

Tags

fakerstatamicstatamic-addonfactorystatamic

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aerni-statamic-factory/health.svg)

```
[![Health](https://phpackages.com/badges/aerni-statamic-factory/health.svg)](https://phpackages.com/packages/aerni-statamic-factory)
```

###  Alternatives

[aerni/factory

Quickly whip up fake content

193.5k](/packages/aerni-factory)[aerni/livewire-forms

A Statamic forms framework powered by Laravel Livewire

2912.8k](/packages/aerni-livewire-forms)[visuellverstehen/statamic-classify

A useful helper to add CSS classes to all HTML tags generated by the bard editor.

20116.8k](/packages/visuellverstehen-statamic-classify)[marcorieser/statamic-livewire

A Laravel Livewire integration for Statamic.

2381.5k10](/packages/marcorieser-statamic-livewire)[withcandour/aardvark-seo

Save time and get your Statamic site to rank better with the SEO addon for Statamic.

13128.3k](/packages/withcandour-aardvark-seo)[mitydigital/feedamic

A fully-featured RSS and Atom feed generator for Statamic.

1064.0k](/packages/mitydigital-feedamic)

PHPackages © 2026

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