omatech/auto-faker
Composer 安装命令:
composer require omatech/auto-faker
包简介
Generate large amounts of multidimensional arrays without effort
README 文档
README
composer require omatech/auto-faker
php artisan vendor:publish
Usage
For each page you have to create a markup:
1- Define your data
in the folder config/autofaker create a file describing your data in YAML, see the index.yaml for example.
user:
vehicles*:
revisions*:
news*:
menu:
groups*:
links*:
pages+:
The * defines multiple records (the system generates between 3 and 6 randomly)
The + defines multiple laravel pagination records (the system generates between 3 and 6 randomly)
To see the generated sample data use this URL:
/index.html?debug-data=true
If you need an url called users.html then create a file users.html
2- Define your view
You must create a file called resources/views/markup/xxx.blade.php where xxx is the url you are using. See index.blade.php as an example.
3- Create the components needed for your project
4- If you want to modify the default fake data for each record modify the file config/autofaker/fake_record_format.json
}
"status": {
"type": "randomElement",
"params": [
[
"active",
"pending",
"rejected"
]
]
}
}
5- You're DONE!
If you need to add additional fields to each object generated modify the function getFakeRecord in the web.php file.
Test
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/AutoFakerTest
统计信息
- 总下载量: 233
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-04-28