PHPackages                             srmklive/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. [Templating &amp; Views](/categories/templating)
4. /
5. srmklive/bootforms

ActiveLibrary[Templating &amp; Views](/categories/templating)

srmklive/bootforms
==================

Just a Formbuilder with some Bootstrap specific conveniences. Remembers old input, retrieves error messages and handles all your boilerplate Bootstrap markup automatically.

v1.0.3(6y ago)017MITPHPPHP &gt;=5.6.4

Since Feb 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/srmklive/bootstrap-forms)[ Packagist](https://packagist.org/packages/srmklive/bootforms)[ RSS](/packages/srmklive-bootforms/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

[![StyleCI](https://camo.githubusercontent.com/4cfb992c120398553074183d18407c6b35d53fd429e03844ea52e2bb8bc51434/68747470733a2f2f7374796c6563692e696f2f7265706f732f3131353731363034332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/115716043)[![Build Status](https://camo.githubusercontent.com/c308d4aaf094cc121a000f8e84dff3f76ddafae297ae96988a7c3ca254e88735/68747470733a2f2f7472617669732d63692e6f72672f73726d6b6c6976652f626f6f7473747261702d666f726d732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/srmklive/bootstrap-forms)

Introduction
============

[](#introduction)

This plugin allows you to rapidly generate forms in your Laravel applications.

Credits
=======

[](#credits)

This package is a fork of [bootforms](https://github.com/adamwathan/bootforms) by [Adam Wathan](https://github.com/adamwathan) which is not actively maintained.

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

You can install this package via Composer by running this command in your terminal in the root of your project:

```
composer require srmklive/bootforms
```

### Laravel

[](#laravel)

If you are using Laravel 5 or greater, you can get started very quickly by registering the included service provider.

Modify the `providers` array in `config/app.php` to include the `BootFormsServiceProvider`:

```
'providers' => [
    //...
    Srmklive\BootForms\BootFormsServiceProvider::class
  ],
```

Add the `BootForm` facade to the `aliases` array in `config/app.php`:

```
'aliases' => [
    //...
    'BootForm' => Srmklive\BootForms\Facades\BootForm::class
  ],
```

You can now start using BootForms by calling methods directly on the `BootForm` facade:

```
BootForm::text('Email', 'email');
```

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');
```

### 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/adamwathan/form#model-binding).

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

Related Resources
-----------------

[](#related-resources)

- [Laravel Translatable BootForms](https://github.com/Propaganistas/Laravel-Translatable-Bootforms), integrates BootForms with Dimsav's [Laravel Translatable](https://github.com/dimsav/laravel-translatable) package

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 71.8% 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 ~167 days

Total

4

Last Release

2523d ago

### Community

Maintainers

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

---

Top Contributors

[![adamwathan](https://avatars.githubusercontent.com/u/4323180?v=4)](https://github.com/adamwathan "adamwathan (102 commits)")[![srmklive](https://avatars.githubusercontent.com/u/839335?v=4)](https://github.com/srmklive "srmklive (11 commits)")[![jesseleite](https://avatars.githubusercontent.com/u/5187394?v=4)](https://github.com/jesseleite "jesseleite (11 commits)")[![moura137](https://avatars.githubusercontent.com/u/1171111?v=4)](https://github.com/moura137 "moura137 (4 commits)")[![robbiepaul](https://avatars.githubusercontent.com/u/2804149?v=4)](https://github.com/robbiepaul "robbiepaul (2 commits)")[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (2 commits)")[![Propaganistas](https://avatars.githubusercontent.com/u/6680176?v=4)](https://github.com/Propaganistas "Propaganistas (2 commits)")[![nathanleclaire](https://avatars.githubusercontent.com/u/1476820?v=4)](https://github.com/nathanleclaire "nathanleclaire (1 commits)")[![sdebacker](https://avatars.githubusercontent.com/u/134503?v=4)](https://github.com/sdebacker "sdebacker (1 commits)")[![Sobak](https://avatars.githubusercontent.com/u/1347533?v=4)](https://github.com/Sobak "Sobak (1 commits)")[![cpgo](https://avatars.githubusercontent.com/u/739891?v=4)](https://github.com/cpgo "cpgo (1 commits)")[![clemblanco](https://avatars.githubusercontent.com/u/668419?v=4)](https://github.com/clemblanco "clemblanco (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)")[![manavo](https://avatars.githubusercontent.com/u/259487?v=4)](https://github.com/manavo "manavo (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[robsontenorio/mary

Gorgeous UI components for Livewire powered by daisyUI and Tailwind

1.5k454.7k15](/packages/robsontenorio-mary)[livewire/blaze

A tool for optimizing Blade component performance by folding them into parent templates

688221.3k17](/packages/livewire-blaze)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)[konekt/html

HTML and Form Builders for the Laravel Framework

24403.2k5](/packages/konekt-html)

PHPackages © 2026

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