Seeder by CartThrob Version 1.2.0
About CartThrob Seeder
CartThrob Seeder is a Data Seeding Platform for ExpressionEngine 6.1 and above. It allows for the Seeding of Channel Entries and Members into an ExpressionEngine installation through both ExpressionEngine Actions and Command Line tools. It also allows third party developers the ability to create their own custom "Seeds".
Table of Contents
- About CartThrob Seeder
- How CartThrob Seeder Works
- Channel Entry Library
- Creating a Channel Entry FieldType
- Creating Seed Objects
- Changelog
Features
- Adds and Removes fake data to your ExpressionEngine website.
- Robust API to create your own Seed objects for use.
- Works with both ExpressionEngine Actions and Commands.
- API for FieldType developers to implement their Fields into Seeder.
How CartThrob Seeder Works
CartThrob Seeder allows you to specify which type of data to Seed, how many of them to create, which child data to create, and will keep a record internally so the creation can be reversed. All data is sandboxed solely with Seeded data (with few exceptions) and can be purged when ready.
Create Fake Data
Out of the box, CartThrob Seeder allows you to create both ExpressionEngine Members and Channel Entries. For both, CartThrob Seeder uses your configured Fields (Channel and Member Fields) to determine what type of data to create. For example, the Email Field will contain a fake email, the URL field will include a fake URL, the Rich Text Editor contains a few paragraphs of Lorem Ipsum, etc.
Members
Command Line
./system/eecli.php cartthrob:seeder:seed --type member --limit 10 --role members
Action URL
https://yoursite.com/?ACT=XX&type=member&role=members
All created Members have obfuscated and impractical credentials (for security) but every Member Field will contain data.
Channel Entries
Command Line
php ./system/eecli.php cartthrob:seeder:seed --type entry --limit 10 --channel news
Action URL
https://yoursite.com/?ACT=XX&type=entry&channel=news
CartThrob Seeder operates by reading your Channel configuration and dynamically generates content based on the Channel Field Type used. For example, the Channel Entry Title is generated using random Lorem Ipsum words, the Rich Text Editor Field Type generates random HTML, and the Colorpicker Field Type generates a random color code for the field, etc.
Note this requires at least 100 Fake Members be created before processing or they'll be created as well and will be required to add the Member Role flag like the below:
Command Line
php ./system/eecli.php cartthrob:seeder:seed --type entry --limit 10 --channel news --role members
Action URL
https://yoursite.com/?ACT=XX&type=entry&channel=news&role=members
Extensibility
Note that CartThrob Seeder uses the Faker PHP library to generate Fake data.
CartThrob Seeder has 3 methods of extensibility:
Remove Fake Data
Once you're done, Seeder can remove all Fake data from across your system. You can do this in 2 ways:
Remove By Type
If you only want to remove XX amount of a Seed Type, you can do this with a simple command:
Command Line
php ./system/eecli.php cartthrob:seeder:cleanup --type entry --limit 10
Action URL
https://yoursite.com/?ACT=YY&type=entry&limit=10
Complete Reset
To remove all Seeded data from your system:
Command Line
php ./system/eecli.php cartthrob:seeder:purge
Action URL
https://yoursite.com/?ACT=YY&type=reset