New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

tpenaranda/duckform

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tpenaranda/duckform

Laravel package to modelize Forms/Surveys and handle them using API endpoints.

Source
Packagist
Version
v1.0.0
Version published
Total downloads
20
Maintainers
1
Created
Source

Laravel Duckform

Latest Stable Version Total Downloads License

WIP > This is on a very early stage < WIP

Laravel package to modelize Forms/Surveys, save them into DB and handle them using API endpoints.

For FE VueJS components please ping tate@tpenaranda.com (npm package will be available by 2020).

This package is being used to feed a VueJS app as you can see below. Form schema is defined this way.

Installation

Require package

$ composer require tpenaranda/duckform

Run migrations in order to create tables for forms schemas and user responses.

$ php artisan migrate

Seed DB with a sample form

php artisan db:seed --class TPenaranda\\Duckform\\Database\\Seeders\\DuckformSeeder

Alternatively you can use factories to generate random form.

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.

Keywords

form

FAQs

Package last updated on 01 Dec 2019

Related posts