2017 © Pedro Peláez
 

library forger

Intended to allow fast creation of populated model instances for database seeding.

image

jcloutz/forger

Intended to allow fast creation of populated model instances for database seeding.

  • Wednesday, March 19, 2014
  • by jcloutz
  • Repository
  • 1 Watchers
  • 2 Stars
  • 166 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Fast Model Mockups in Laravel

Build Status, (*1)

This package is intended to allow for the fast creation of database objects in Laravel., (*2)

Installation

I the require key of your compser.json add the following., (*3)

"jcloutz/forger": "dev-master"

Run the compoer update command, (*4)

$ composer update

Usage

Forger adds the ability to quickly retrieve a populated mockup of any model in your project. The Faker Package to generate mockup data based on an array of values., (*5)

<?php // namespace Models;

use Jcloutz\Mocker\MockerTrait;

class Widget extends Eloquent
{
    use ForgerTrait;

    protected $table = 'widgets';

    protected $fillable = [];

    public static $mockable = array(
        'name'  => 'A Fancy Widget', // Static data
        'cost'  => 'randomFloat|2|0|100', // Faker method with arguments
        'price' => 'call|uppercase|word', // Call to user function with data from faker
    );

    public function uppercase($string)
    {
        return strtoupper($string);
    }
}

The ForgerTrait provides two static functions to models ::forge() and ::forgeCreate()., (*6)

    // Returns an instance of Widget without saving it to the database.
    $widget = Widget::forge();

    // Returns an instance of Widget and saves it to the database.
    $widget = Widget::forgeCreate();

License

WTFPL, (*7)

The Versions

19/03 2014

dev-master

9999999-dev

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge

19/03 2014

1.0.2

1.0.2.0

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge

19/03 2014

dev-develop

dev-develop

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge

19/03 2014

1.0.1

1.0.1.0

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge

19/03 2014

dev-hotfix/1.0.1

dev-hotfix/1.0.1

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge

18/03 2014

1.0.0

1.0.0.0

Intended to allow fast creation of populated model instances for database seeding.

  Sources   Download

WTFPL

The Requires

 

by Jeremy Cloutier

laravel faker seeding forge