Giter Club home page Giter Club logo

kusikusi-forms's Introduction

Kusikusi Forms Controllers

This is a read-only repository, splitted from the monorepo at github.com/cuatromedios/kusikusi-monorepo

For the Laravel starter kit visit github.com/cuatromedios/kusikusi

Software License Travis Total Downloads

Install

This package complements kusikusi/models and kusikusi/website packages, that should be required first.

composer require kusikusi/forms

Usage

Publish the assets

  • Publish all the assets ...
    php artisan vendor:publish --provider="Kusikusi\FormServiceProvider"
  • Or Publish individual Assets

    Configuration

    php artisan vendor:publish --provider="Kusikusi\FormServiceProvider" --tag="config"

Migrations

php artisan migrate

Receiving forms

  • Any form you want to be processed by Kusikusi Forms, set the action to /form and method to post
  • Include the Laravel CSRF token
  • Include a hidden field named entity_id with the entity id value of the current page
    <form action="/form" method="post">
        <input name="name" />
        <input name="email" type="email" />
        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
        <input type="hidden" name="entity_id" value="{{ $entity->id }}" />
        <button type="submit">Enviar</button>
    </form>
  • The entity referenced should have in the properties field, a property named form with specific params:
    • fields an object with the keys as the field names and values as the validation string for that field, if a field is not described here will be ignored.
    • mail_to an email address if you want to send the entry to an email address. You should have mail values configured in your Laravel project.
    {
      "form": {
        "mail_to": "[email protected]",
        "fields": {
          "name": {
            "validation": "required|max:50"
          },
          "email": {
            "validation": "required|email"
          }
        }
      }
    }

Routes

This Kusikusi Forms Package, has a routes specific for form entries management

Receiving form entries

POST /form

API endpoints to manage the entries.

GET /formentries/
GET /formentries/{formentry_id}
PATCH GET /formentries/{formentry_id}
DELETE GET /formentries/{formentry_id}

Testing

Run the tests with:

vendor/bin/phpunit

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Security

If you discover any security-related issues, please email dev@cuatromedios instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

kusikusi-forms's People

Contributors

ramsesmoreno avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.