This repository contains an enhanced version of the original Laravel Form Builder Package, designed to create drag-and-drop forms using JQuery Form Builder. It features dynamic generation of models, migrations, and management of form-associated tables.
You can install the original package using the following command:
composer require doode/laravel-formbuilder
To install this enhanced version, follow the steps below:
- Laravel 7
- Bootstrap 4+
- MySQL/MariaDB
- Laravel Authentication
Install Laravel UI for authentication:
composer require laravel/ui
php artisan ui bootstrap --auth
composer require navidanjum/enhanced_laravel_form_builder:dev-main
If users face issues installing directly, they can manually add your GitHub repository to their composer.json file:
"repositories": [
{
"type": "vcs",
"url": "https://github.com/NavidAnjum/Enhanced_Laravel_Form_Builder.git"
}
]
Then run:
composer require navidanjum/enhanced_laravel_form_builder:dev-main
php artisan migrate
php artisan vendor:publish --provider="NavidAnjum\EnhancedFormBuilder\EnhancedFormBuilderServiceProvider" --tag=formbuilder-views
php artisan vendor:publish --tag=formbuilder-public
php artisan vendor:publish --tag=formbuilder-config
Update your Blade layout to include the following:
@stack('styles') <!-- Include styles -->
@stack('scripts') <!-- Include scripts -->
- Automatically generates an Eloquent model and database table when a user creates a new form.
- Models include
protected $fillable
fields based on the form structure.
- Provides full CRUD functionality for dynamically created tables.
- Users can add, update, and delete records in these tables.
- Synchronizes updates to forms with associated database tables, including column renaming and schema updates.
- Ensures data integrity during schema changes.
- Seamless integration with Laravel's MVC architecture for scalable and dynamic data management.
- Users design a new form using the drag-and-drop builder.
- Example JSON representation of a form:
[ {"type":"text","label":"Name","className":"form-control","name":"name"} ]
- The system generates:
- A new table:
forms
- A model:
Form
- A new table:
- Updating a form reflects changes in the database table schema.
- Data is preserved during schema updates.
- Submissions are saved to dynamically created tables.
- Example table structure:
CREATE TABLE forms ( id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) NULL, created_at TIMESTAMP NULL, updated_at TIMESTAMP NULL );
- View, edit, and delete records stored in dynamically created tables.
- jQuery UI: For user interface actions.
- jQuery Formbuilder: Drag-and-drop form editing.
- clipboard.js: Copy text to clipboard.
- parsley.js: Form validation.
- moment.js: Date and time handling.
- footable: Responsive table plugin.
- sweetalert: Enhanced alert messages.
- Add advanced field types (e.g., file uploads).
- Improve UI/UX for managing forms and submissions.
- Expand form permissions for finer control.
- Ensure the database contains a
users
table with a columnid
(BIGINT UNSIGNED
). - Avoid editing forms with existing submissions unless necessary, as it may affect older submissions.
This package is open-sourced software licensed under the MIT license.