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

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

anahkiasen/former
=================

A powerful form builder

5.1.1(10mo ago)1.4k1.4M—5.2%203[4 issues](https://github.com/formers/former/issues)[1 PRs](https://github.com/formers/former/pulls)14MITPHPPHP ^7.2|^8.0CI passing

Since Sep 27Pushed 10mo ago61 watchersCompare

[ Source](https://github.com/formers/former)[ Packagist](https://packagist.org/packages/anahkiasen/former)[ Docs](http://formers.github.io/former/)[ RSS](/packages/anahkiasen-former/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (74)Used By (14)

Former
======

[](#former)

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

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

[![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)

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::framework('TwitterBootstrap3');

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

  Former::xlarge_text('name') # Bootstrap sizing
    ->class('myclass') # arbitrary attribute support
    ->label('Full name')
    ->value('Joseph')
    ->required() # HTML5 validation
    ->help('Please enter your full name');

  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

```

Publish config files with artisan:

```
php artisan vendor:publish --provider="Former\FormerServiceProvider"

```

#### App.php config for Laravel 5.4 and below

[](#appphp-config-for-laravel-54-and-below)

For Laravel 5.4 and below, you must 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',

```

---

### Documentation

[](#documentation)

Please refer to the [wiki](https://github.com/formers/former/wiki) for the full documentation.

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance54

Moderate activity, may be stable

Popularity65

Solid adoption and visibility

Community44

Growing community involvement

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 67.9% 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 ~67 days

Recently: every ~121 days

Total

70

Last Release

304d ago

Major Versions

3.5.10 → 4.0.42016-04-08

3.5.11 → 4.0.52016-04-18

3.5.12 → 4.1.02017-01-27

4.6.0 → 5.0.0-alpha2021-01-21

4.9.0 → 5.0.02024-06-03

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

3.5.0PHP &gt;=5.4.0

4.5.0PHP &gt;=7.2.0

4.6.0PHP ^7.2|^8.0

### Community

Maintainers

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

---

Top Contributors

[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (816 commits)")[![claar](https://avatars.githubusercontent.com/u/402855?v=4)](https://github.com/claar "claar (118 commits)")[![petercoles](https://avatars.githubusercontent.com/u/2947594?v=4)](https://github.com/petercoles "petercoles (74 commits)")[![tortuetorche](https://avatars.githubusercontent.com/u/5038872?v=4)](https://github.com/tortuetorche "tortuetorche (39 commits)")[![stayallive](https://avatars.githubusercontent.com/u/1090754?v=4)](https://github.com/stayallive "stayallive (26 commits)")[![patrickcarlohickman](https://avatars.githubusercontent.com/u/6036266?v=4)](https://github.com/patrickcarlohickman "patrickcarlohickman (19 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (13 commits)")[![weotch](https://avatars.githubusercontent.com/u/77567?v=4)](https://github.com/weotch "weotch (12 commits)")[![menthol](https://avatars.githubusercontent.com/u/1001497?v=4)](https://github.com/menthol "menthol (8 commits)")[![adamfeuer](https://avatars.githubusercontent.com/u/324915?v=4)](https://github.com/adamfeuer "adamfeuer (8 commits)")[![rmasters](https://avatars.githubusercontent.com/u/34284?v=4)](https://github.com/rmasters "rmasters (7 commits)")[![wisepotato](https://avatars.githubusercontent.com/u/1401260?v=4)](https://github.com/wisepotato "wisepotato (6 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)")[![syphernl](https://avatars.githubusercontent.com/u/639906?v=4)](https://github.com/syphernl "syphernl (5 commits)")[![fonograph](https://avatars.githubusercontent.com/u/4312895?v=4)](https://github.com/fonograph "fonograph (4 commits)")[![gazard7](https://avatars.githubusercontent.com/u/4010449?v=4)](https://github.com/gazard7 "gazard7 (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)")[![maqnouch](https://avatars.githubusercontent.com/u/3692812?v=4)](https://github.com/maqnouch "maqnouch (3 commits)")

---

Tags

form-builderlaravel-packagelaravelbootstrapfoundationform

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

74310.9M66](/packages/laravel-mcp)

PHPackages © 2026

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