Questionnaires
Description
Questionnaires provides questionnaire definitions, question banks, answer dictionaries, and questionnaire takes for Laravel Enso.
The package exposes CRUD APIs for answers and questions, execution endpoints for questionnaire takes, and form/table builders for all major questionnaire entities.
It is intended for internal survey, audit, onboarding, or rule-driven question flows where answers may be typed, predefined, conditional, and persisted in multiple stages.
Installation
Install the package:
composer require laravel-enso/questionnaires
Run the package migrations:
php artisan migrate
Optional publishes:
php artisan vendor:publish --tag=questionnaires-config
php artisan vendor:publish --tag=questionnaires-assets
Features
- Question, answer, and questionnaire-take APIs with table init, table data, and Excel export flows.
- Shared questionnaire options endpoint for dependent selects.
- Support for typed answers through the
AnswerTypesenum. - Range answer endpoint for generating predefined numeric intervals.
- Persist flow for questionnaire takes separate from take creation.
Usage
Main route groups:
qres.answers.*qres.questions.*qres.qreTakes.*qres.options
Supported typed answer families:
- numeric
- boolean
- date
- freetext
- predefined
The question form captures questionnaire membership, display order, required flag, allows-multiple flag, and the question body. Questionnaire takes are created first, then persisted through the dedicated persist endpoint.
API
HTTP routes
GET api/qres/optionsGET api/qres/answers/createPOST api/qres/answersGET api/qres/answers/{answer}/editPATCH api/qres/answers/{answer}DELETE api/qres/answers/{answer}GET api/qres/answers/initTableGET api/qres/answers/tableDataGET api/qres/answers/exportExcelGET api/qres/answers/optionsGET api/qres/questions/createPOST api/qres/questionsGET api/qres/questions/{question}/editPATCH api/qres/questions/{question}DELETE api/qres/questions/{question}GET api/qres/questions/initTableGET api/qres/questions/tableDataGET api/qres/questions/exportExcelGET api/qres/questions/optionsPOST api/qres/questions/{question}/rangeAnswerPOST api/qres/qreTakesPOST api/qres/qreTakes/{qreTake}/persistGET api/qres/qreTakes/initTableGET api/qres/qreTakes/tableDataGET api/qres/qreTakes/exportExcel
Depends On
Required Enso packages:
Companion frontend package: