PHPackages                             gourmet/muffin - 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. gourmet/muffin

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

gourmet/muffin
==============

FactoryMuffin support for CakePHP 3

v0.1.1(11y ago)28.5k[1 issues](https://github.com/gourmet/muffin/issues)MITPHP

Since Mar 27Pushed 11y ago2 watchersCompare

[ Source](https://github.com/gourmet/muffin)[ Packagist](https://packagist.org/packages/gourmet/muffin)[ Docs](https://github.com/gourmet/muffin)[ RSS](/packages/gourmet-muffin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Muffin
======

[](#muffin)

[![Total Downloads](https://camo.githubusercontent.com/32f5becae90f4ec33be7201e4b13f28a5d604501a8fe0b259371655a75801374/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f6d756666696e2f646f776e6c6f6164732e737667)](https://packagist.org/packages/gourmet/muffin)[![License](https://camo.githubusercontent.com/70e7809fe84b80e1e4a6be387e12add5d0c4228afa32966142023626f9ef65ba/68747470733a2f2f706f7365722e707567782e6f72672f676f75726d65742f6d756666696e2f6c6963656e73652e737667)](https://packagist.org/packages/gourmet/muffin)

[FactoryMuffin](https://github.com/thephpleague/factory-muffin) for [CakePHP 3](https://cakephp.org).

About
-----

[](#about)

Out of the box FactoryMuffin wraps [Faker](/fzaninotto/faker) methods to generate dummy data for your entities.

I originally started by releasing [gourmet/faker](http://github.com/gourmet/faker), which worked great for inserting dummy data to use in demos and even in tests. However, as time went by, I realized that in many cases, I was just repeating myself. That's when I remembered [@savant](http://github.com/savant) mentioning [FactoryMuffin](https://github.com/thephpleague/factory-muffin) to me a while back and after a quick look, it became obvious this was exactly what I needed.

I still use the [Faker](http://github.com/gourmet/faker) plugin, because in some cases just absracting everything using factories ends up being even more work. So, if you need granularity when creating dummy data, try it; but in most cases, stick to this one.

Usage
-----

[](#usage)

```
composer require --dev gourmet/muffin:~0.1

```

No need to load it in `bootstrap.php`.

Example
-------

[](#example)

Assuming you have a `Posts` model (table, entity and fixture), to create fake data, you'll first need to define the factory in `tests/Factory/PostFactory`:

```
