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
This package complements kusikusi/models and kusikusi/website packages, that should be required first.
composer require kusikusi/forms
-
php artisan vendor:publish --provider="Kusikusi\FormServiceProvider"
-
Configuration
php artisan vendor:publish --provider="Kusikusi\FormServiceProvider" --tag="config"
php artisan migrate
- Any form you want to be processed by Kusikusi Forms, set the action to
/form
and method topost
- 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 namedform
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": "contact@example.com", "fields": { "name": { "validation": "required|max:50" }, "email": { "validation": "required|email" } } } }
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}
Run the tests with:
vendor/bin/phpunit
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security-related issues, please email dev@cuatromedios instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.