Details

  • View On packagist
  • Created by Simon Funk
  • Added on Aug 31, 2017
  • Total Downloads: 26
  • Monthly Downloads: 1
  • Daily Downloads: 0
  • Favourites: 4

Formbuilder

A Formbuilder to create and manage your forms and submissions

This Formbuilder module allows you to easily drag and drop your form together.
It automaticaly stores all submissions of your forms included your created fields.

You can duplicate your form to other languages and generate the form HTML code to edit it.

Formbuilder

This module is working, but in a very alpha version. Using is at your own risk! You are welcome to work on it

Requirements

To display the forms in the frontend, it requires the Shortcode Module of Pingpong Sky Labs:

http://sky.pingpong-labs.com/docs/2.0/shortcode

For captcha image, we use the package from Drew Phillips https://www.phpcaptcha.org/

Please add this to your composer.json file:

    "dapphp/securimage": "~3.5"

Link to GitHub: https://github.com/dapphp/securimage

Instructions

To make it work, you need to add a middleware to the Page Module.

Add a file PageMiddleware.php inside Modules/Page/Http/Middleware

Put follwing content into it:

<?php

namespace Modules\Page\Http\Middleware;

use Closure;
use Shortcode;

class PageMiddleware
{
    /**
     * Run the request filter.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $response   = $next($request);
        $response->setContent(Shortcode::compile($response->original));
        return $response;
    }
}

Adjust the routes in Modules/Page/Http/frontendRoutes.php to

    $router->get('{uri}', ['middleware'=>'page','uses' => 'PublicController@uri', 'as' => 'page']);
    $router->get('/', ['middleware'=>'page','uses' => 'PublicController@homepage', 'as' => 'homepage']);

And add to app/Http/Kernel.php to $routeMiddleware

        'page' => 'Modules\Page\Http\Middleware\PageMiddleware',

That's it.

Permission

Don't forget to set the Permissions.

Notice

At the moment, the output are Bootstrapped Fields and Wrappers. This will be changed in the future.

TODO

Make Layout more flexible

Module Download

Install any module with the php artisan asgard:download:module command.

php artisan asgard:download:module stonelab/formbuilder --migrations

This will download the module and run its migrations.

Composer

composer require stonelab/formbuilder

This is if the module is perfect for your use-case as-is, and doesn't need any changes to fit your needs.

Note: Don't forget to give yourself the required permissions before you can view the backend entries.

Mobile Analytics