This package provides the standard form builder functionality used in most projects.
You can install the package via composer:
composer require dcodegroup/form-builderThen run the install command.
php artisan form-builder:installThis will publish the configuration file and the migration file.
Run the migrations
php artisan migrateInclude this built file to your layouts:
<script type="text/javascript" src="/vendor/form-builder/index.js" defer></script>
There is a new generated file under public/vendor/form-builder/index.css. You must use this file in your main scss file
Run the npm build (dev/prod)
npm run devMost of configuration has been set the fair defaults. However you can review the configuration file at config/form-builder.php and adjust as needed
return [
'middleware' => ['web', 'auth'],
'layout_path' => 'layouts.app', // Make sure you have correct base layout name,
'content_section' => 'content', // Name of your content section
'route_path' => 'forms', // eg 'admin/settings/waivers',
'route_name' => 'forms', // eg 'admin.setting.waivers',
'binding' => 'form' // eg 'waiver',
]
The package provides an endpoints which you can use. See the full list by running
php artisan route:list --name=formThey are
[example.com/forms] Which is where you will form index. This is by default protected auth middleware but you can modify in the configuration. This is where you want to link to in your admin and possibly a new window
Create new folder name form-builder-views under resources/views section then put following files to override:
edit.blade.php
index.blade.php
show.blade.php
Located in
src\Http\Traits\FormValidator.php