PHPackages                             enriquejlicona/bootforms - 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. enriquejlicona/bootforms

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

enriquejlicona/bootforms
========================

Form builder with Bootstrap-specific conveniences. Remembers old input, retrieves error messages and handles all your boilerplate Bootstrap markup automatically.

1.6.1(4y ago)08MITPHPPHP &gt;=7.0

Since Oct 9Pushed 4y agoCompare

[ Source](https://github.com/enriquejliconal/bootforms)[ Packagist](https://packagist.org/packages/enriquejlicona/bootforms)[ RSS](/packages/enriquejlicona-bootforms/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (5)Versions (49)Used By (0)

[![Build Status](https://camo.githubusercontent.com/357e0c2bc873812f72c70431f5f82e7cf9cda684dd318f07f2a8451dbb6950e5/68747470733a2f2f7472617669732d63692e6f72672f676c68642f626f6f74666f726d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/glhd/bootforms) [![Coverage Status](https://camo.githubusercontent.com/8676f78211ee65dc0789a4e0b1a7c56aff625925a95a7fe5fe3d3bba45f008a0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f676c68642f626f6f74666f726d732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/glhd/bootforms?branch=master)

BootForms
=========

[](#bootforms)

BootForms is a Laravel package to rapidly generate markup for standard Bootstrap 3 forms. Probably not perfect for your super custom branded ready-for-release apps, but a *huge* time saver when you are still in the prototyping stage!

Check out Aire
--------------

[](#check-out-aire)

This package has been replaced by [Aire](https://github.com/glhd/aire) which is a modern form builder with similar features but an improved API, more tests, more documentation, and support for non-Bootstrap themes. It uses [Tailwind](https://tailwindcss.com/) by default, but has full support for Bootstrap via a plugin.

BootForms is no longer actively maintained. I'll try to merge any bugfixes for the forseeable future, but I strongly urge you to check out Aire.

Fork
----

[](#fork)

This package forks abandoned [Adam Wathan's repository](https://github.com/adamwathan/bootforms)to provide support for newer Laravel versions as well as following changes over the original package:

- support for package autodiscovery
- improved support for IDE autocompletion (using `laravel-ide-helper`)
- improved support for model binding
- changed into Laravel-only package to simplify experience even more
- dropped support for Laravel versions older than 5.5

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installing-with-composer)
- [Using BootForms](#using-bootforms)
    - [Basic Usage](#basic-usage)
    - [Customizing Elements](#customizing-elements)
    - [Reduced Boilerplate](#reduced-boilerplate)
    - [Automatic Validation State](#automatic-validation-state)
    - [Horizontal Forms](#horizontal-forms)
    - [Additional Tips](#additional-tips)
- [Related Resources](#related-resources)

Installing with Composer
------------------------

[](#installing-with-composer)

This package supports Laravel autodiscovery so all you have to do is running this command in your terminal in the root of your project:

```
composer require galahad/bootforms
```

Using BootForms
---------------

[](#using-bootforms)

### Basic Usage

[](#basic-usage)

BootForms lets you create a label and form control and wrap it all in a form group in one call.

```
//
//
//      Field Label
//
//
//
{!! BootForm::open() !!}
{!! BootForm::text('Field Label', 'field_name') !!}
{!! BootForm::close() !!}
```

> Note: Don't forget to `open()` forms before trying to create fields! BootForms needs to know if you opened a vertical or horizontal form before it can render a field, so you'll get an error if you forget.

### Customizing Elements

[](#customizing-elements)

If you need to customize your form elements in any way (such as adding a default value or placeholder to a text element), simply chain the calls you need to make and they will fall through to the underlying form element.

Attributes can be added either via the `attribute` method, or by simply using the attribute name as the method name.

```
//
//    First Name
//
//
BootForm::text('First Name', 'first_name')->placeholder('John Doe');

//
//   Color
//
//     Red
//     Green
//
//
BootForm::select('Color', 'color')->options(['red' => 'Red', 'green' => 'Green'])->select('green');

//
BootForm::open()->get()->action('/users');

//
//    First Name
//
//
BootForm::text('First Name', 'first_name')->defaultValue('John Doe');
```

For more information about what's possible, check out the documentation for the [basic Forms package.](https://github.com/glhd/forms)

### Reduced Boilerplate

[](#reduced-boilerplate)

Typical Bootstrap form boilerplate might look something like this:

```

    First Name

    Last Name

    Date of Birth

    Email address

    Password

  Submit

```

BootForms makes a few decisions for you and allows you to pare it down a bit more:

```
{!! BootForm::open() !!}
  {!! BootForm::text('First Name', 'first_name') !!}
  {!! BootForm::text('Last Name', 'last_name') !!}
  {!! BootForm::date('Date of Birth', 'date_of_birth') !!}
  {!! BootForm::email('Email', 'email') !!}
  {!! BootForm::password('Password', 'password') !!}
  {!! BootForm::submit('Submit') !!}
{!! BootForm::close() !!}
```

### Automatic Validation State

[](#automatic-validation-state)

Another nice thing about BootForms is that it will automatically add error states and error messages to your controls if it sees an error for that control in the error store.

Essentially, this takes code that would normally look like this:

```

  First Name

  {!! $errors->first('first_name', ':message') !!}

```

And reduces it to this:

```
{!! BootForm::text('First Name', 'first_name') !!}
```

...with the `has-error` class being added automatically if there is an error in the session.

### Horizontal Forms

[](#horizontal-forms)

To use a horizontal form instead of the standard basic form, simply swap the `BootForm::open()` call with a call to `openHorizontal($columnSizes)` instead:

```
// Width in columns of the left and right side
// for each breakpoint you'd like to specify.
$columnSizes = [
  'sm' => [4, 8],
  'lg' => [2, 10]
];

{!! BootForm::openHorizontal($columnSizes) !!}
  {!! BootForm::text('First Name', 'first_name') !!}
  {!! BootForm::text('Last Name', 'last_name') !!}
  {!! BootForm::text('Date of Birth', 'date_of_birth') !!}
  {!! BootForm::email('Email', 'email') !!}
  {!! BootForm::password('Password', 'password') !!}
  {!! BootForm::submit('Submit') !!}
{!! BootForm::close() !!}
```

### Additional Tips

[](#additional-tips)

#### Hiding Labels

[](#hiding-labels)

You can hide labels by chaining the `hideLabel()` helper off of any element definition.

`BootForm::text('First Name', 'first_name')->hideLabel()`

The label will still be generated in the markup, but hidden using Bootstrap's `.sr-only` class, so you don't reduce the accessibility of your form.

#### Help Blocks

[](#help-blocks)

You can add a help block underneath a form element using the `helpBlock()` helper.

`BootForm::text('Password', 'password')->helpBlock('A strong password should be long and hard to guess.')`

> Note: This help block will automatically be overridden by errors if there are validation errors.

#### Model Binding

[](#model-binding)

BootForms makes it easy to bind an object to a form to provide default values. Read more about it [here](https://github.com/glhd/forms#data-binding).

```
BootForm::open()->action( route('users.update', $user) )->put()
BootForm::bind($user)
BootForm::close()
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 56.4% 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 ~75 days

Recently: every ~170 days

Total

42

Last Release

1529d ago

Major Versions

v0.9.0 → v1.0.02017-09-21

PHP version history (3 changes)v0.1PHP &gt;=5.3.0

v0.5.0PHP &gt;=5.4.0

v1.0.0PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![adamwathan](https://avatars.githubusercontent.com/u/4323180?v=4)](https://github.com/adamwathan "adamwathan (102 commits)")[![inxilpro](https://avatars.githubusercontent.com/u/21592?v=4)](https://github.com/inxilpro "inxilpro (40 commits)")[![jesseleite](https://avatars.githubusercontent.com/u/5187394?v=4)](https://github.com/jesseleite "jesseleite (11 commits)")[![enriquejliconal](https://avatars.githubusercontent.com/u/52460714?v=4)](https://github.com/enriquejliconal "enriquejliconal (5 commits)")[![moura137](https://avatars.githubusercontent.com/u/1171111?v=4)](https://github.com/moura137 "moura137 (4 commits)")[![bogdankharchenko](https://avatars.githubusercontent.com/u/32746389?v=4)](https://github.com/bogdankharchenko "bogdankharchenko (3 commits)")[![Sobak](https://avatars.githubusercontent.com/u/1347533?v=4)](https://github.com/Sobak "Sobak (2 commits)")[![Propaganistas](https://avatars.githubusercontent.com/u/6680176?v=4)](https://github.com/Propaganistas "Propaganistas (2 commits)")[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (2 commits)")[![robbiepaul](https://avatars.githubusercontent.com/u/2804149?v=4)](https://github.com/robbiepaul "robbiepaul (2 commits)")[![sdebacker](https://avatars.githubusercontent.com/u/134503?v=4)](https://github.com/sdebacker "sdebacker (1 commits)")[![jgrossi](https://avatars.githubusercontent.com/u/1175275?v=4)](https://github.com/jgrossi "jgrossi (1 commits)")[![cpgo](https://avatars.githubusercontent.com/u/739891?v=4)](https://github.com/cpgo "cpgo (1 commits)")[![django23](https://avatars.githubusercontent.com/u/827397?v=4)](https://github.com/django23 "django23 (1 commits)")[![JavierMartinz](https://avatars.githubusercontent.com/u/1155507?v=4)](https://github.com/JavierMartinz "JavierMartinz (1 commits)")[![clemblanco](https://avatars.githubusercontent.com/u/668419?v=4)](https://github.com/clemblanco "clemblanco (1 commits)")[![manavo](https://avatars.githubusercontent.com/u/259487?v=4)](https://github.com/manavo "manavo (1 commits)")[![nathanleclaire](https://avatars.githubusercontent.com/u/1476820?v=4)](https://github.com/nathanleclaire "nathanleclaire (1 commits)")

---

Tags

laravelbootstrapFormsbootformsBootForm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/enriquejlicona-bootforms/health.svg)

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

###  Alternatives

[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[patricktalmadge/bootstrapper

Twitter Bootstrap markup generator

557407.2k4](/packages/patricktalmadge-bootstrapper)[barryvdh/laravel-form-bridge

This packages integrates Symfony Form Component in Laravel.

163354.8k1](/packages/barryvdh-laravel-form-bridge)[netojose/laravel-bootstrap-4-forms

Bootstrap 4 form builder for Laravel 5

182115.3k](/packages/netojose-laravel-bootstrap-4-forms)[galahad/bootforms

Form builder with Bootstrap-specific conveniences. Remembers old input, retrieves error messages and handles all your boilerplate Bootstrap markup automatically.

1161.6k](/packages/galahad-bootforms)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)

PHPackages © 2026

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