1. Go to this page and download the library: Download nomensa/form-builder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Http\Controllers;
class MyGreatFormController extends Controller
{
...
public function create()
{
$entryForm = EntryForm::where('slug','my-form')->firstOrFail();
$formVersion = $entryForm->currentFormVersion;
$formBuilder = $formVersion->getFormBuilder();
// TODO: In a future release this will be tidied so errors are pulled from the session automatically
$errors = new MessageBag();
$arrSession = session()->all();
if (isSet($arrSession['errors'])) {
$errors = $arrSession['errors']->getBag('default');
}
$formBuilder->errors = $errors;
$formBuilder->setState('editing');
$formBuilder->setDisplayMode('creating');
return view('form.create', $formBuilder->viewData);
}
}
bash
$ php artisan formbuilder:make-form MY-FORM "My First Form"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.