PHPackages                             robin-malfait/formgenerator - 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. robin-malfait/formgenerator

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

robin-malfait/formgenerator
===========================

781.9k26[6 issues](https://github.com/RobinMalfait/Laravel-auto-form-generator/issues)[2 PRs](https://github.com/RobinMalfait/Laravel-auto-form-generator/pulls)PHP

Since Jan 12Pushed 10y ago8 watchersCompare

[ Source](https://github.com/RobinMalfait/Laravel-auto-form-generator)[ Packagist](https://packagist.org/packages/robin-malfait/formgenerator)[ RSS](/packages/robin-malfait-formgenerator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Form Generator
==============

[](#form-generator)

This is a auto form generator for Laravel 4. This package allows you to auto generate a form from a model.

- [Form Generator on Packagist](https://packagist.org/packages/robin-malfait/formgenerator)
- [Form Generator on GitHub](https://github.com/RobinMalfait/Laravel-auto-form-generator)

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

[](#installation)

To add this form generator to your Laravel application follow this steps:

Add the following to your `composer.json` file:

```
"robin-malfait/formgenerator": "dev-master"

```

Then run `composer update` or `composer install` if you have not already installed packages.

Add below to the `providers` array in `app/config/app.php` configuration file (add at the end):

```
'RobinMalfait\Formgenerator\FormgeneratorServiceProvider'

```

Add `'Formgenerator' => 'RobinMalfait\Formgenerator\Facades\Formgenerator',` to the `aliases` array also in `app/config/app.php`

What's new
----------

[](#whats-new)

- You can now flag all fields with 'form-control' for Bootstrap 3 users.

```
	'extras'	=> array(
		'*'		=> array('class' => 'form-control')
	)
```

- You may now use hidden fields and set values to those hidden elements. The label associated will be hidden.

```
	'customers_id'	=> array(
		'type'		=>	'hidden',
		'value'		=>	2
	)
```

- The ability to add custom labels in the `extras` array:

    `'label' => 'Supercalifragilisticexpialidocious'`

How to use it
-------------

[](#how-to-use-it)

Let's make a form now, you can either pass an object like `$user` OR you can pass `table_name` as a string instead of the $model variable like so:

```
{{ Form::open() }}
	{{ Formgenerator::generate('table_name_here') }}
{{ Form::close() }}
```

With a $model object

```
{{ Form::model($user) }}
	{{ Formgenerator::generate($user) }}
{{ Form::close() }}
```

As a second param you can pass an options array for example:

```
{{ Form::model($user) }}
	{{ Formgenerator::generate($user, array(

		// If you want a specific type, put it in here, default is type from the database
		'types' => array(
			// Field Name 	=> Type
			'all_day' 		=> 'checkbox',

			// Support for hidden fields (auto-hides associated label) and setting values!
			'customers_id'			=> array(
				'type'		=>	'hidden',
				'value'		=>	2
			),

			// If you want a select field with options
			'first_name'	=> array(
				'type'		=> 'select',
				'options'	=> array(
					'Taftse' 	=> 'Taftse',
					'Robin'		=> 'Robin',
					'Jeffrey'	=> 'Jeffrey'
				),
			),
		),

		// Add a class to a field
		'extras' => array(
			// Field Name   => array('key' => 'value'),
			'first_name' 			=> array(
				'class' 			=> 'span5',
				'content_before'	=> 'My Form'
			),
			'last_name'				=> array(
				'class' 			=> 'span5',
				'content_before'	=> ''
			),
			'activated' 	=> array(
				'class' 		=> '',
				'content_after'	=> ''

				// Set a custom label if you want
				'label' => 'Supercalifragilisticexpialidocious'
			),

			// Wildcards, those will be added to every field except for the fields that are listed above.

			// If you specify the *form-control* class, all fields will have form-control applied their class list.
			// This is great for Bootstrap 3 users, but keep in mind, the above functionality will break due to
			// all fields being given a class.

			'*'				=> array(
				'class' 	=> 'span5 form-control'
			)
		),

		// Submit? Yes or no? Set the text and set a class if you want
		'submit' => array(
			'show' 	=> true,
			'text'  => 'Save',
			'class' => 'btn btn-success btn-large'
		),

		// Fields to not display!
		'exclude' => array(
			'event_type', 'id', 'created_at', 'updated_at', 'for_user_id'
		),

		// Show labels
		'showLabels' => true,

	)) }}
{{ Form::close() }}
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1d15f545525638a2bf16604c8513260b5614ba54d97648c261041366497dde0?d=identicon)[RobinMalfait](/maintainers/RobinMalfait)

---

Top Contributors

[![RobinMalfait](https://avatars.githubusercontent.com/u/1834413?v=4)](https://github.com/RobinMalfait "RobinMalfait (21 commits)")[![benbridts](https://avatars.githubusercontent.com/u/1301221?v=4)](https://github.com/benbridts "benbridts (1 commits)")[![ee0pdt](https://avatars.githubusercontent.com/u/6094917?v=4)](https://github.com/ee0pdt "ee0pdt (1 commits)")

### Embed Badge

![Health badge](/badges/robin-malfait-formgenerator/health.svg)

```
[![Health](https://phpackages.com/badges/robin-malfait-formgenerator/health.svg)](https://phpackages.com/packages/robin-malfait-formgenerator)
```

###  Alternatives

[kirschbaum-development/nova-inline-select

An inline select field for Laravel Nova apps.

95486.7k1](/packages/kirschbaum-development-nova-inline-select)[bdelespierre/php-kmeans

K-Means algorithm for PHP

91134.1k3](/packages/bdelespierre-php-kmeans)[paulzi/yii2-adjacency-list

Adjacency List Behavior for Yii2

68237.4k16](/packages/paulzi-yii2-adjacency-list)[ckfinder/ckfinder-symfony-bundle

CKFinder bundle for Symfony

42435.7k](/packages/ckfinder-ckfinder-symfony-bundle)[stevegrunwell/time-constants

A series of constants designed to make it easier to express time in PHP applications

28402.4k2](/packages/stevegrunwell-time-constants)[savvot/random

Deterministic pseudo-random generators library with dozens of useful functions and several sources of randomness

21243.7k5](/packages/savvot-random)

PHPackages © 2026

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