joegabdelsater/survey-generator
最新稳定版本:v1.0.0
Composer 安装命令:
composer require joegabdelsater/survey-generator
包简介
This package is a plug and play package for creating survey feature to your project
README 文档
README
composer require joegabdelsater/survey-generator
Step 2
php artisan vendor:publish and select the appropriate package number
Step 3
php artisan migrate
Functions
To use the package add to your class use Joegabdelsater\SurveyGenerator
For dummy data creation
SurveyGenerator::generateForm()
SurveyGenerator::generateAnswers()
Make sure you have a user with id 1 as it is hardcoded in the function
For use
-
SurveyGenerator::getSurveyForm($surveyId = false)if $surveyId is not passed, the first survey is retrieved -
SurveyGenerator::getAnsweredSurvey($surveyId = false, $userId = false)if $surveyId is not passed, the first survey is retrieved, $userId is used in the testing functions -
SurveyGenerator::submit()it accesses the $request object directly, make sure to pass the survey_id, and the answers should have a key ofquestion_{$questionId}.
if the question type is text, the value should be what is gathered from the user input. if not, the option_id should be provided
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-17