PHPackages                             weotch/former - 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. weotch/former

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

weotch/former
=============

A powerful form builder

4.1.0(9y ago)13.4k11MITPHPPHP &gt;=5.4.0

Since Sep 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weotch/former)[ Packagist](https://packagist.org/packages/weotch/former)[ Docs](http://anahkiasen.github.com/former/)[ RSS](/packages/weotch-former/feed)WikiDiscussions populate-eloquent-collection Synced 4w ago

READMEChangelog (2)Dependencies (10)Versions (45)Used By (1)

Former
======

[](#former)

A Laravelish way to create and format forms
-------------------------------------------

[](#a-laravelish-way-to-create-and-format-forms)

[![Build Status](https://camo.githubusercontent.com/c174cf40144935019caee9a1ae1f209c47294d1f477b405f84d00c413e874d76/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f666f726d6572732f666f726d65722e7376673f7374796c653d666c6174)](https://travis-ci.org/formers/former)[![Latest Stable Version](https://camo.githubusercontent.com/0b8e341e7e26913df099bdce3f353714f2ceea14027b4825fc4f53d69c9372bd/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e61686b696173656e2f666f726d65722e7376673f7374796c653d666c6174)](https://packagist.org/packages/anahkiasen/former)[![Total Downloads](https://camo.githubusercontent.com/d5c1883a2bc3c88513310b002485488bb4a00988615367f5515edf23e71ecfc5/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e61686b696173656e2f666f726d65722e7376673f7374796c653d666c6174)](https://packagist.org/packages/anahkiasen/former))

### For Laravel 4, use the [master branch](https://github.com/formers/former/tree/master)

[](#for-laravel-4-use-the-master-branch)

Former outputs form elements in HTML compatible with your favorite CSS framework (Bootstrap and Foundation are currently supported). Former also handles repopulation after validation errors, including automatically rendering error text with affected fields.

### Introduction

[](#introduction)

Former provides a fluent method of form creation, allowing you to do:

```
Former::horizontal_open()
  ->id('MyForm')
  ->rules(['name' => 'required'])
  ->method('GET');

  Former::xlarge_text('name') # Bootstrap sizing
    ->class('myclass') # arbitrary attribute support
    ->value('Joseph')
    ->required(); # HTML5 validation

  Former::textarea('comments')
    ->rows(10)->columns(20)
    ->autofocus();

  Former::actions()
    ->large_primary_submit('Submit') # Combine Bootstrap directives like "lg and btn-primary"
    ->large_inverse_reset('Reset');

Former::close();
```

Every time you call a method that doesn't actually exist, Former assumes you're trying to set an attribute and creates it magically. That's why you can do in the above example `->rows(10)` ; in case you want to set attributes that contain dashes, just replace them by underscores : `->data_foo('bar')` equals `data-foo="bar"`. Now of course in case you want to set an attribute that actually contains an underscore you can always use the fallback method `setAttribute('data_foo', 'bar')`. You're welcome.

This is the core of it, but Former offers a lot more. I invite you to consult the wiki to see the extent of what Former does.

---

### Installation

[](#installation)

Require Former package using Composer:

```
composer require anahkiasen/former   # For Laravel 4, use anahkiasen/former:~3.5

```

Then run "composer update". Next modify your `config/app.php`. In the `providers` array add :

```
Former\FormerServiceProvider::class

```

Add then alias Former's main class by adding its facade to the `aliases` array in the same file :

```
'Former' => 'Former\Facades\Former',

```

If you don't use Laravel, you can add Former to your Composer file, then use it with:

```
use Former\Facades\Former;
```

### Table of contents

[](#table-of-contents)

- [Getting started](https://github.com/formers/former/wiki/Getting-started)
- [Features](https://github.com/formers/former/wiki/Features)
- [Usage and Examples](https://github.com/formers/former/wiki/Usage-and-Examples)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

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

Every ~41 days

Recently: every ~88 days

Total

41

Last Release

3372d ago

Major Versions

3.5.8 → 4.0.02015-09-15

3.5.9 → 4.0.x-dev2015-11-05

3.5.10 → 4.0.42016-04-08

3.5.11 → 4.0.52016-04-18

3.5.12 → 4.0.72016-10-20

PHP version history (2 changes)3.4.3PHP &gt;=5.3.0

3.5.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/77567?v=4)[Robert Reinhard](/maintainers/weotch)[@weotch](https://github.com/weotch)

---

Top Contributors

[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (816 commits)")[![petercoles](https://avatars.githubusercontent.com/u/2947594?v=4)](https://github.com/petercoles "petercoles (74 commits)")[![claar](https://avatars.githubusercontent.com/u/402855?v=4)](https://github.com/claar "claar (72 commits)")[![patrickcarlohickman](https://avatars.githubusercontent.com/u/6036266?v=4)](https://github.com/patrickcarlohickman "patrickcarlohickman (19 commits)")[![weotch](https://avatars.githubusercontent.com/u/77567?v=4)](https://github.com/weotch "weotch (19 commits)")[![adamfeuer](https://avatars.githubusercontent.com/u/324915?v=4)](https://github.com/adamfeuer "adamfeuer (8 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (8 commits)")[![menthol](https://avatars.githubusercontent.com/u/1001497?v=4)](https://github.com/menthol "menthol (8 commits)")[![tortuetorche](https://avatars.githubusercontent.com/u/5038872?v=4)](https://github.com/tortuetorche "tortuetorche (8 commits)")[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (7 commits)")[![ignaciovazquez](https://avatars.githubusercontent.com/u/679016?v=4)](https://github.com/ignaciovazquez "ignaciovazquez (6 commits)")[![NelinD](https://avatars.githubusercontent.com/u/10078264?v=4)](https://github.com/NelinD "NelinD (6 commits)")[![wisepotato](https://avatars.githubusercontent.com/u/1401260?v=4)](https://github.com/wisepotato "wisepotato (6 commits)")[![syphernl](https://avatars.githubusercontent.com/u/639906?v=4)](https://github.com/syphernl "syphernl (5 commits)")[![gazard7](https://avatars.githubusercontent.com/u/4010449?v=4)](https://github.com/gazard7 "gazard7 (4 commits)")[![fonograph](https://avatars.githubusercontent.com/u/4312895?v=4)](https://github.com/fonograph "fonograph (4 commits)")[![vlakoff](https://avatars.githubusercontent.com/u/544424?v=4)](https://github.com/vlakoff "vlakoff (3 commits)")[![michelbrito](https://avatars.githubusercontent.com/u/43976?v=4)](https://github.com/michelbrito "michelbrito (3 commits)")[![andrewryno](https://avatars.githubusercontent.com/u/50643?v=4)](https://github.com/andrewryno "andrewryno (3 commits)")[![dwightwatson](https://avatars.githubusercontent.com/u/1100408?v=4)](https://github.com/dwightwatson "dwightwatson (2 commits)")

---

Tags

laravelbootstrapfoundationform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/weotch-former/health.svg)

```
[![Health](https://phpackages.com/badges/weotch-former/health.svg)](https://phpackages.com/packages/weotch-former)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M126](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M143](/packages/laravel-mcp)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M129](/packages/laravel-pulse)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M82](/packages/unisharp-laravel-filemanager)

PHPackages © 2026

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