superbig / craft3-faker
Fake data
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:craft-plugin
Requires
- craftcms/cms: ~3.0.0-beta.23
- fzaninotto/faker: v1.7.1
This package is auto-updated.
Last update: 2024-11-27 03:57:49 UTC
README
This plugin is a WIP version, and is not really ready to use yet.
Create elements with fake data, swiftly.
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require superbig/craft3-faker
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Faker.
Faker Overview
-Insert text here-
Configuring Faker
Add jobs in the config file.
Typehint the element type and the Faker Generator (autoinjected) to autocomplete method in IDEs like PHPStorm.
<?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
Faker Roadmap
- Try to make it more flexible/support any elements?
Brought to you by Superbig