elgibor-solution / laravel-form-builder
A Laravel package for managing form builder resources.
Package info
github.com/elgiborsolution/laravel-form-builder
pkg:composer/elgibor-solution/laravel-form-builder
Requires
- php: >=8.2
- illuminate/cache: ^10.0|^11.0|^12.0
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
README
Laravel Form Builder is a backend package for building dynamic data sources, reusable API configurations, and form-driven CRUD flows without writing a new controller for every use case. It is designed for teams that want a configurable, JSON-friendly builder layer on top of Laravel.
Live Demo
GitHub Repository
https://github.com/elgiborsolution/laravel-form-builder.git
Table of Contents
Features
- Dynamic form builder
- Data source builder
- API builder
- Import/export configuration
- Middleware support
- Dynamic validation
- Custom query support
- Reusable API configuration
- JSON-based configuration
- Dynamic select datasource
- Form API integration
Installation
1. Require the package
composer require elgibor-solution/laravel-form-builder
2. Publish configuration
php artisan vendor:publish --provider="ESolution\DataSources\Providers\DataSourcesServiceProvider" --tag=datasources-config
3. Publish migrations
php artisan vendor:publish --provider="ESolution\DataSources\Providers\DataSourcesServiceProvider" --tag=datasources-migrations
4. Run migrations
php artisan migrate
5. Verify route prefix
By default, package routes are registered under the api prefix. You can adjust this in config/datasources.php or with environment variables such as:
DATASOURCES_ROUTE_PREFIX=api DATASOURCES_ROUTE_VERSION=
6. Configure the package database connection
Set the connection the package should use for its models, queries, and migrations:
LARAVEL_FORM_BUILDER_DB_CONNECTION=tenant
The package will fall back to DB_CONNECTION and then mysql when this variable is not set. You can also read the resolved value from config:
config('laravel-form-builder.database_connection')
Quick Start
- Create a data source for your table or custom SQL.
- Create an API config if you need a public dynamic endpoint.
- Use the form builder to define fields and bind select options.
- Call the generated endpoint from your frontend or server-to-server integration.
Example:
GET /api/data-source/users-list/query?page=1&per_page=10
Response example:
{
"current_page": 1,
"data": [
{
"id": 1,
"name": "Alice",
"email": "alice@example.com"
}
],
"total": 1
}
Documentation
- Installation
- Getting Started
- Data Source
- Data API Builder
- Form Builder
- Import / Export
- Authentication
- Examples
- Troubleshooting
- FAQ
Architecture
The package is organized around a small set of backend layers:
Controllersaccept management requests for builders and runtime API requests.Modelsstore the configuration records such as data sources, API configs, listeners, permissions, and mappings.Servicesturn configuration into executable queries.Supportclasses resolve dynamic routes and normalize endpoint lookups.Providersregister routes, migrations, and configuration.
High-level flow:
- A developer creates a builder configuration.
- The configuration is persisted in Laravel models and database tables.
- The runtime route resolver finds the matching API config.
- The query service validates input, builds SQL, and returns the response.
Support
If you are documenting the package for your team, start with: