https://github.com/tpenaranda/duckform
Laravel package to modelize Forms/Surveys, save them into DB and handle them using API endpoints. Compatible with VueJS using https://github.com/tpenaranda/vue-duckform package.
https://github.com/tpenaranda/duckform
forms typeform vuejs
Last synced: about 1 month ago
JSON representation
Laravel package to modelize Forms/Surveys, save them into DB and handle them using API endpoints. Compatible with VueJS using https://github.com/tpenaranda/vue-duckform package.
- Host: GitHub
- URL: https://github.com/tpenaranda/duckform
- Owner: tpenaranda
- Created: 2019-11-18T10:08:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-04T01:07:27.000Z (over 6 years ago)
- Last Synced: 2025-08-03T15:35:13.876Z (11 months ago)
- Topics: forms, typeform, vuejs
- Language: PHP
- Homepage: https://vue-duckform-demo.tpenaranda.com/
- Size: 271 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Laravel Duckform
[](https://packagist.org/packages/tpenaranda/duckform) [](https://packagist.org/packages/tpenaranda/duckform) [](https://packagist.org/packages/tpenaranda/duckform)
Laravel package to modelize Forms/Surveys, save them into DB and handle them using API endpoints. There is a VueJS package to handle the FE side ([see here](https://github.com/tpenaranda/vue-duckform)).
Check https://vue-duckform-demo.tpenaranda.com for a live version of the FE side.
*Form schema is defined [this way](https://raw.githubusercontent.com/tpenaranda/duckform/master/src/Database/Seeders/FormExamples/patient-intake-questionnaire.php).*
## Installation
### Require package
```bash
$ composer require tpenaranda/duckform
```
### Run migrations in order to create tables for forms schemas and user responses.
```bash
$ php artisan migrate
```
### Seed DB with a sample form
```bash
php artisan db:seed --class TPenaranda\\Duckform\\Database\\Seeders\\DuckformSeeder
```
### Alternatively you can use factories to generate random form.
```bash
php artisan tinker
>>> use TPenaranda\Duckform\Facade\Duckform\Duckform
>>> use TPenaranda\Duckform\Models\Form
>>> Duckform::factory(Form::class)->states('with-sections-with-questions-with-possible-answers')->create()
```
### Routes (remember `php artisan route:list` for entire list)
```
Form objects (Form structure)
=============================
GET 'api/duckforms/' Get all Forms.
GET 'api/duckforms/{id-slug-token}' Get single Form.
FormSubmit objects (Data submitted for a Form)
==============================================
POST 'api/duckforms/{id-slug-token}/submits' Create a FormSubmit.
PATCH 'api/duckforms/{id-slug-token}/submits/{submitToken}' Modify a FormSubmit
GET 'api/duckforms/{id-slug-token}/submits/{formSubmitToken}' Get a single FormSubmit.
GET 'api/duckforms/{id-slug-token}/submits' Get all submits for a single Form.
```