PHPackages                             rayhan-kobir/dynamic-form-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rayhan-kobir/dynamic-form-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rayhan-kobir/dynamic-form-generator
===================================

A dynamic form generator with grid support for Laravel

v1.0.0(1y ago)12MITPHPPHP ^8.0

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MdRayhanKobir/rayhan-dynamic-form-generator)[ Packagist](https://packagist.org/packages/rayhan-kobir/dynamic-form-generator)[ RSS](/packages/rayhan-kobir-dynamic-form-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Dynamic Form Generator for Laravel
==================================

[](#dynamic-form-generator-for-laravel)

The **Dynamic Form Generator** is a Laravel package designed to simplify form creation by generating forms dynamically from a configuration array. It supports multiple input types, Bootstrap grid layouts, and integrates seamlessly with Laravel's features like CSRF protection and validation.

Installation
------------

[](#installation)

Run the following command in your terminal to install the package:

```
composer require rayhan-kobir/dynamic-form-generator
```

Verify Service Provider Registration
====================================

[](#verify-service-provider-registration)

The package uses Laravel's auto-discovery to register its service provider. If auto-discovery is disabled in your project, manually add the provider to the providers array in config/app.php:

```
'providers' => [
    // Other providers...
    Rayhan\DynamicFormGenerator\DynamicFormGeneratorServiceProvider::class,
],
```

How to use in blade file
========================

[](#how-to-use-in-blade-file)

```
 @rayhanDynamicForm([
                        'action' => 'contact.submit',
                        'method' => 'POST',
                        'fields' => [
                            ['type' => 'text', 'name' => 'full_name', 'label' => 'Full Name', 'class' => 'form--control', 'col' => 'col-md-6','required' => true],
                            ['type' => 'email', 'name' => 'email', 'label' => 'Email Address', 'class' => 'form--control', 'col' => 'col-md-6'],
                            ['type' => 'password', 'name' => 'password', 'label' => 'Password', 'class' => 'form--control', 'col' => 'col-md-6'],
                            ['type' => 'number', 'name' => 'age', 'label' => 'Your Age', 'class' => 'form--control', 'col' => 'col-md-6'],
                            ['type' => 'date', 'name' => 'dob', 'label' => 'Date of Birth', 'class' => 'form--control', 'col' => 'col-md-6'],
                            ['type' => 'range', 'name' => 'experience', 'label' => 'Experience Level', 'min' => 1, 'max' => 10, 'class' => 'form--control', 'col' => 'col-md-6'],
                            ['type' => 'hidden', 'name' => 'token', 'value' => 'xyz123'],
                            ['type' => 'textarea', 'name' => 'address', 'label' => 'Your Address', 'class' => 'form--control', 'col' => 'col-md-12'],
                            [
                                'type' => 'select',
                                'name' => 'country',
                                'label' => 'Select Country',
                                'class' => 'form--control',
                                'col' => 'col-md-6',
                                'options' => [
                                    'bd' => 'Bangladesh',
                                    'us' => 'United States',
                                    'uk' => 'United Kingdom',
                                    'ca' => 'Canada',
                                ],
                            ],
                            [
                                'type' => 'radio',
                                'name' => 'gender',
                                'label' => 'Gender',
                                'class' => 'form-check-input',
                                'col' => 'col-md-6',
                                'options' => [
                                    'male' => 'Male',
                                    'female' => 'Female',
                                    'other' => 'Other',
                                ],
                            ],
                            [
                                'type' => 'checkbox',
                                'name' => 'hobbies[]',
                                'label' => 'Select Your Hobbies',
                                'class' => 'form-check-input',
                                'col' => 'col-md-6',
                                'options' => [
                                    'reading' => 'Reading',
                                    'sports' => 'Sports',
                                    'music' => 'Music',
                                ],
                            ],
                            ['type' => 'file', 'name' => 'profile_picture', 'label' => 'Upload Profile Picture', 'class' => 'form--control', 'col' => 'col-md-6'],
                        ],
                        'buttons' => [['type' => 'submit', 'label' => 'Submit', 'class' => 'btn btn--base'], ['type' => 'reset', 'label' => 'Reset', 'class' => 'btn btn--danger']],
                    ])
```

How to use validation in a controller?
======================================

[](#how-to-use-validation-in-a-controller)

```
  $formConfig = json_decode($request->input('form_config'), true);
        $form = new DynamicFormGenerator($formConfig);
        $validationResult = $form->validate($request);

        if ($validationResult !== true) {
            return $validationResult;
        }
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fd96da0fdd4813b346d8f0d7a17e0fe5f666e0ee14d34affab5341d0627f054?d=identicon)[MdRayhanKobir](/maintainers/MdRayhanKobir)

---

Top Contributors

[![MdRayhanKobir](https://avatars.githubusercontent.com/u/87905794?v=4)](https://github.com/MdRayhanKobir "MdRayhanKobir (5 commits)")

### Embed Badge

![Health badge](/badges/rayhan-kobir-dynamic-form-generator/health.svg)

```
[![Health](https://phpackages.com/badges/rayhan-kobir-dynamic-form-generator/health.svg)](https://phpackages.com/packages/rayhan-kobir-dynamic-form-generator)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M685](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M861](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
