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

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

larvata-tw/former
=================

A custom form builder

5.0.1(4y ago)01.1kMITPHPPHP &gt;=5.4.0

Since Sep 27Pushed 4y ago2 watchersCompare

[ Source](https://github.com/LarvataTW/former)[ Packagist](https://packagist.org/packages/larvata-tw/former)[ Docs](https://github.com/LarvataTW/former)[ RSS](/packages/larvata-tw-former/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (10)Versions (51)Used By (0)

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)

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',

```

### 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

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

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

###  Release Activity

Cadence

Every ~70 days

Recently: every ~339 days

Total

47

Last Release

1733d ago

Major Versions

3.5.9 → 4.0.12015-11-05

3.5.10 → 4.0.42016-04-08

3.5.11 → 4.0.52016-04-18

3.5.12 → 4.12017-02-09

4.1.6 → 5.0.12021-08-11

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

3.5.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/454329b1585b32dd61d8d9cd57ce9e765f3ad7e94091a41baa480ad2a7985ed5?d=identicon)[JackyYin](/maintainers/JackyYin)

---

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 (112 commits)")[![petercoles](https://avatars.githubusercontent.com/u/2947594?v=4)](https://github.com/petercoles "petercoles (74 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)")[![tortuetorche](https://avatars.githubusercontent.com/u/5038872?v=4)](https://github.com/tortuetorche "tortuetorche (9 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)")[![JackyYin](https://avatars.githubusercontent.com/u/7500954?v=4)](https://github.com/JackyYin "JackyYin (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)")[![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)")[![vlakoff](https://avatars.githubusercontent.com/u/544424?v=4)](https://github.com/vlakoff "vlakoff (3 commits)")

---

Tags

laravelbootstrapfoundationform

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)

PHPackages © 2026

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