2017 © Pedro Peláez
 

craft-plugin craft3-faker

Fake data

image

superbig/craft3-faker

Fake data

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Faker plugin for Craft CMS 3.x

This plugin is a WIP version, and is not really ready to use yet., (*1)

Create elements with fake data, swiftly., (*2)

Screenshot, (*3)

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later., (*4)

Installation

To install the plugin, follow these instructions., (*5)

  1. Open your terminal and go to your Craft project:, (*6)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*7)

    composer require superbig/craft3-faker
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Faker., (*8)

Faker Overview

-Insert text here-, (*9)

Configuring Faker

Add jobs in the config file., (*10)

Typehint the element type and the Faker Generator (autoinjected) to autocomplete method in IDEs like PHPStorm., (*11)

<?php
use craft\elements\Tag;
use Faker\Generator;

return [
    // Add your fakery jobs
    "jobs" => [
        'tag' => function (Tag $tag, Generator $faker) {
            $tag->title   = $faker->company;
            $tag->groupId = 1;

            return $tag;
        }
    ],
];

Using Faker

Run the jobs through the console command ./craft faker --job=tag --count=100 --element=tag, (*12)

Faker Roadmap

  • Try to make it more flexible/support any elements?

Brought to you by Superbig, (*13)

The Versions

18/11 2017

dev-master

9999999-dev

Fake data

  Sources   Download

MIT

The Requires

 

cms faker craftcms craft-plugin craft