Skip to content

Al-Amin-Ceazer/dynamic-form--builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Dynamic Form Package

Issues Stars

This Package will generate dynamic form Data based on json data Structure

Quick Installation

composer require alaminceazer/form

Service Provider & Facade (Optional on Laravel 5.5+)

Register provider and facade on your config/app.php file.

'providers' => [
    ...,
    AlAmin\Form\FormServiceProvider::class,
]

Configuration

php artisan vendor:publish --provider="AlAmin\Form\FormServiceProvider"

You should now have a config/form.php file that allows you to configure the basics of this package And that's it!

Lumen Installation

Copy the config

Copy the config file from vendor/alaminceazer/from/src/config/form.php to config folder of your Lumen application and rename it to form.php

Register your config by adding the following in the bootstrap/app.php before middleware declaration.

$app->configure('form');

Bootstrap file changes

Add the following snippet to the bootstrap/app.php file under the providers section as follows:

$app->register(AlAmin\Form\FormServiceProvider::class);

NOTE: By default in form.php configuration file get_key_by_name value is id. You need change this key value to form_id to get data by the form_id you provided while creation.

API Documentation

// Sample POST request
curl --location --request POST '{{base_url}}/dynamic-form/forms' \
--header 'Content-Type: application/json' \
--data-raw '{
    "source": "MYGP_new",
    "form_id": 344,
    "slug": "success-page",
    "cache_key": "some:key",
    "data": "{\"data1\": [], \"data2\": []}"
}'

//Sample GET request
curl --location --request GET '{{base_url}}/dynamic-form/forms/1' \
--header 'Content-Type: application/json'

Start building out some awesome Form!

About

This Package will generate dynamic form Data based on json data Structure

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages