Download the PHP package mrgiant/form-builder without Composer
On this page you can find all versions of the php package mrgiant/form-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mrgiant/form-builder
More information about mrgiant/form-builder
Files in mrgiant/form-builder
Package form-builder
Short Description A Laravel form-builder module: dynamic forms, questions, responses, approval workflows, with Vue 3 builder components and Blade renderers.
License MIT
Homepage https://github.com/mrgiant/form-builder
Informations about the package form-builder
mrgiant/form-builder
A Laravel form-builder module extracted from the GoldenHospital application: dynamic forms, questions/fields, responses, and an approval-workflow engine, with Vue 3 builder components and Blade renderers (including PDF templates).
- Backend:
Form,Question,Answer,FormResponse, plus the workflow models (FormResponseWorkflow,FormResponseWorkflowAction,FormWorkflowNode,FormWorkflowEdge), 5 controllers, and all migrations. - Frontend: a drag-and-drop question builder, a visual workflow builder, 12 field-type renderers, responses list, and an approvals inbox/tracker.
- Views: public form render (
custom_render), pre-filled render, and PDF templates.
Requirements
- PHP
^8.2 - Laravel
^12or^13
Host-provided dependencies
This package was extracted from a monolith and is designed to be consumed by
that same application. The controllers and the Translatable concern therefore
still reference a handful of classes that the host app must provide. These
are intentionally left pointing at the App\ namespace:
| Referenced class | Used by | Purpose |
|---|---|---|
App\Http\Controllers\Controller |
all controllers | base controller (auth/validation traits) |
App\Models\User |
WorkflowController, FormResponseWorkflowAction, Services\WorkflowRunner |
approver identity |
App\Notifications\GeneralNotficationMailsAttachment |
AnswerController |
submit-notification email (host-env: shells out to a node PDF script + hardcoded domain) |
App\Http\Services\ReportsGenerator\PdfFooter |
ResponsesController |
PDF footer |
App\Http\TranslatorAction\Translator, App\Models\Translation |
Concerns\Translatable |
i18n fields |
The workflow engine and its collaborators now live in the package —
Mrgiant\FormBuilder\Services\WorkflowRunner,
Mrgiant\FormBuilder\Notifications\FormWorkflowNotification, and
Mrgiant\FormBuilder\Rules\UniqueAnswerResponses — since they are form-domain
logic, not host infrastructure. The remaining App\ references above are
genuine host concerns (identity, generic mail/PDF/Excel tooling, i18n).
Installation (local path repository)
In the host app's composer.json:
then:
The service provider is auto-discovered. It will:
- load the package migrations (deduped by filename against the host's copies),
- register the
form-builder::view namespace, - register routes only if
config('form-builder.register_routes')is true (off by default to avoid colliding with the host's existing form routes).
Publish what you want to customize:
Frontend
The package ships raw .vue source. Publish it and register the components
on your existing global Vue app:
This registers: forms-index, forms-manage-questions,
forms-questions-answers, forms-responses-index, forms-workflow-builder,
approvals-inbox, approval-tracker, form-charts.
The components require golden-logic-ui, vuedraggable, and Vue 3 in the host.
They also import a few host-provided Vue libraries via the @ alias
(@ → resources/js), which the host must define in vite.config.js:
| Import | Provided by host at |
|---|---|
@/services/multilingualService |
resources/js/services/ |
@/components/fields/* |
shared field inputs (also used by other host features) |
@/components/fieldsAnswer/* |
shared answer-display inputs |
@/components/Charts/Pie.vue |
shared chart components |
These are intentionally not bundled so the host owns a single copy (they are
shared with other host features). Re-run the publish command after updating the
package to refresh the copy under resources/js/vendor/form-builder.
Configuration
config/form-builder.php:
| Key | Default | Meaning |
|---|---|---|
register_routes |
false |
Let the package own the form routes. |
route_prefix |
admin |
URL prefix for the route group. |
route_name_prefix |
admin. |
Route-name prefix (admin.forms.*). |
middleware |
['web', 'auth'] |
Middleware for the route group. |
user_model |
App\Models\User |
Approver model. |
Cutover status (GoldenHospital host)
The cutover has been performed in the GoldenHospital host — the package is the source of truth for the module's models, controllers, and Vue components:
- ✅ Host
app/Models/{Form,Question,Answer,FormResponse,FormResponse*,FormWorkflow*}.phpdeleted; all references repointed toMrgiant\FormBuilder\Models\*. - ✅ Host
app/Http/Controllers/Admin/{Forms,Questions,Answer,Responses,Workflow}Controller.phpdeleted;routes/web.php+routes/api.phpnow reference the package controllers. (The route definitions stay in the host so they keep the host's admin middleware/locale/gate context;register_routesremainsfalse.) - ✅ Host
resources/js/components/cruds/Forms/**andFormCharts.vuedeleted;app.jsregisters the components viaregisterFormBuilder(app, { lazy })from the publishedresources/js/vendor/form-builder.
Remaining (optional) hardening:
- Blade views still live in the host (the controllers render
admin.forms.*/forms.*, which resolve to the host's layouts). The package ships its own copies underform-builder::for external consumers. - Decouple the host-provided PHP classes and Vue libraries (tables above) for a fully standalone package.
License
MIT
All versions of form-builder with dependencies
illuminate/support Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
maatwebsite/excel Version ^3.1