Rapid UI Generation

Laravel Form Builder

Generate complex, responsive HTML forms directly from Laravel classes, complete with automatic validation, localization, and seamless frontend integration.

Open SourceLaravelPackageUI

Field blocks

Drag a block onto the form, or press Enter on it. Reorder with the arrow buttons.

Contact usWe would love to hear from you.
is_active
    database/seeders/ContactFormSeeder.php
    use Hyderkamran\FormBuilder\Models\Form;
    use Hyderkamran\FormBuilder\Models\FormField;
    use Hyderkamran\FormBuilder\Enums\FieldType;
     
    $form = Form::create([
        'title'       => 'Contact Us',
        'slug'        => 'contact-us',
        'description' => 'We would love to hear from you.',
        'is_active'   => true,
    ]);
     
    // Add a block to generate its FormField
    
    Illustrative builder; the generated code follows the README's programmatic API. The package's own drag-and-drop admin lives at /forms/admin.
    Validation and logic

    Rules live on each field

    Every field carries its own required flag and validation rules, and can show or hide itself based on another field's value. Try the country below.

    is_required
    false
    validation_rules
    none
    options.logic
    country = pk, show
    Live preview

    Logic matched: the Province field is shown.

    Illustrative inspector with the README's sample fields
    Conditional logic
    FormField::create([
        // ... other attributes
        'options' => [
            'logic' => [
                'field'    => 'country',   // watch this field
                'operator' => '=',         // =, !=, >, <
                'value'    => 'pk',        // match this value
                'action'   => 'show',      // 'show' or 'hide'
            ],
        ],
    ]);
    
    • =
    • !=
    • >
    • <
    • operators, with a show or hide action. Also set in the admin UI under the Logic tab.
    What ships

    A form system, not just a form tag

    Class-based formsAuto-validationLocalization support
    • Build

      • 21 field types, text to repeater
      • Drag-and-drop admin UI
      • Database-driven form definitions
      • Repeater fields with nested rows
    • Validate

      • Dynamic validation, per-field rules
      • Conditional show and hide logic
      • File and image upload support
    • Deliver

      • Blade directive @form('slug')
      • Embeddable iframe mode
      • JSON API endpoints
      • Caching layer
    • After submit

      • Export to CSV, Excel and PDF
      • Email notifications
      • Webhook support
      • PSR-4, Laravel package conventions
    After you define it

    One definition, every place a form goes

    1. Form definitionStored in the database · then Blade directive, Iframe embed, JSON API
    2. Blade directive@form('contact-us') · then Submission
    3. Iframe embed/forms/{slug}/embed · then Submission
    4. JSON APISchema and submit · then Submission
    5. SubmissionValidated per field · then Email, Webhook, Export
    6. EmailNotifications
    7. WebhookPer form
    8. ExportCSV, Excel, PDF
    How the README's features connect
    Field types

    21 field types in six groups

    • Basic8

      textemailnumbertextareapasswordhiddenurltel
    • Choice4

      selectradiocheckboxtoggle
    • Date and time3

      datedatetimetime
    • Media2

      fileimage
    • Special3

      rangecolorrating
    • Pro1

      repeater
    Admin and API

    An admin for editors, JSON for everything else

    Admin pages
    Dashboard/forms/admin
    Create form/forms/admin/create
    Edit form/forms/admin/{id}/edit
    Submissions/forms/admin/{id}/submissions

    To protect the admin, set admin_middleware to ['web', 'auth'].

    • GET/api/form-builder/forms/{slug}Form schema (JSON)
    • POST/api/form-builder/forms/{slug}/submitSubmit (JSON)
    Submit with cURL
    curl -X POST https://your-app.com/api/form-builder/forms/contact-us/submit \
      -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"name": "Alice", "email": "alice@example.com"}'
    
    Install

    Publish, migrate, build

    Laravel Form Builder is maintained in the open, versioned semantically, and used in our own client projects — so fixes land upstream rather than in a private fork.

    Terminal
    composer require hyderkamran/laravel-form-builder
     
    # Config
    php artisan vendor:publish --tag=form-builder-config
     
    # Migrations
    php artisan vendor:publish --tag=form-builder-migrations
    php artisan migrate
     
    # Frontend assets (drag-and-drop and conditional logic)
    php artisan vendor:publish --tag=form-builder-assets
    

    From the package README on GitHub

    Packagehyderkamran/laravel-form-builder
    LicenceMIT
    LanguagePHP / Laravel
    RequiresPHP ^8.1Laravel 10 or 11
    Maintained byApexlyTech, in the open on GitHub
    View on GitHub

    Stop hand-writing the same form twice

    Generate complex, responsive HTML forms directly from Laravel classes, complete with automatic validation, localization, and seamless frontend integration.