PHPackages                             matthewpatterson/carpenter - 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. [Database &amp; ORM](/categories/database)
4. /
5. matthewpatterson/carpenter

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

matthewpatterson/carpenter
==========================

A library to set up database models with test data

0.1(11y ago)116MITPHP

Since Nov 8Pushed 11y ago1 watchersCompare

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

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

Carpenter
=========

[](#carpenter)

A PHP library for setting up database fixtures, heavily inspired by [FactoryGirl](https://github.com/thoughtbot/factory_girl).

[![Build Status](https://camo.githubusercontent.com/2423771c0a23ed8f13bd10d3ef894d0a4ca07fc46a24eeef06ac145b8fc93665/68747470733a2f2f7472617669732d63692e6f72672f6d617474686577706174746572736f6e2f63617270656e7465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matthewpatterson/carpenter)[![Analytics](https://camo.githubusercontent.com/5862312aa82fa68c04eb41dea5b302fbb57b68ea5f11e0cdbdab98761f4ef956/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d34333030343533382d322f6d617474686577706174746572736f6e2f63617270656e746572)](https://github.com/igrigorik/ga-beacon)

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

[](#installation)

Add the following to a `composer.json` file:

```
{
    "require": {
        "matthewpatterson/carpenter": "*"
    }
}
```

Then, run `composer install`.

Usage
-----

[](#usage)

### Defining Factories

[](#defining-factories)

Factories are free-form classes, allowing for a lot of flexibility in their definition. All you need to make a class a factory is the `@Factory` annotation. For example, consider this factory that won't really do much of anything:

```
