Data Generator application based on Profiles.
You just have to create a profile and generate your data in four formats (CSV, JSON, SQL's insert, SQLite).
I described in the article What's the size of the data? my motivation to develop this project.
A hidden advantage of the Data-Gen is to estimate the size of a given data structure will have in a database and/or in a request's payload.
After git clone
type on console php artisan rosselli:data-gen
.
Available commands.
A profile is the data structure (schema) that will be generated. For example, the Post schema is user_id, category_id, title, resume, text, image, caption, tags, created_at.
- Create a class in
App\Http\Controllers\Profiles
. - Extend Profile
class Posts extends Profiles
. - Call Profile's constructor
parent::__construct($records)
- Implement the Profile's abstract methods
setTableName(), setFolderName(), generateData()
- With Faker library, implement the schema.
Data-Gen has six predefined sets of records to generate.
If you want to customize the sets, edit app/Console/Commands/DataGen.php
Data-Gen generates data in CSV, JSON, SQL's Insert, and Sqlite.
The data is generated in storage/app/data-gen/[profile]
.
After generating the data, type on console php artisan rosselli:report
.