PHPackages                             fewagency/twbs-blade - 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. fewagency/twbs-blade

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

fewagency/twbs-blade
====================

Blade templates for Twitter Bootstrap

v2.1.2(8y ago)11131[1 issues](https://github.com/bjuppa/twbs-blade/issues)MITPHP

Since Jun 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/bjuppa/twbs-blade)[ Packagist](https://packagist.org/packages/fewagency/twbs-blade)[ RSS](/packages/fewagency-twbs-blade/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

Blade templates for Twitter Bootstrap
=====================================

[](#blade-templates-for-twitter-bootstrap)

**This package is no longer maintained!**Please see [fewagency/fluent-form](https://github.com/bjuppa/fluent-form) and [fewagency/fluent-html](https://github.com/bjuppa/fluent-html) for the replacements we use!

A collection of [Laravel Blade templates](http://laravel.com/docs/master/blade) for displaying [Twitter Bootstrap](http://getbootstrap.com) html elements and components.

Configuration
-------------

[](#configuration)

Add this to your list of providers in config/app.php:

```
'FewAgency\TwbsBlade\TwbsBladeServiceProvider',
```

Usage examples
--------------

[](#usage-examples)

### Single input field

[](#single-input-field)

Example:

```
@include('bsb::input.text', ['name'=>'test', 'label'=>'Your email address'])
```

### Printing a full form

[](#printing-a-full-form)

Example:

```
@include('bsb::form', ['action' => action('ExampleController@update', $model->getKey()), 'model' => $model, 'groups' => [
    'title' => ['label' => 'Name'],
    'content' => ['label' => 'Text', 'help_text' => 'This is displayed next to the input and connected to it with aria-describedby'],
    'number' => ['label' => "A number", 'type'=>'number'],
    'currency_code' => ['type' => 'select', 'label' => "Currency", 'options' => ['SEK' => 'Svenska kronor', 'GBP' => 'British Pounds']],
    'Save'
]])
```

Form options
------------

[](#form-options)

Each form will contain a hidden csrf-field and by default display validation information next to each input.

### groups

[](#groups)

An array of inputs (or other elements) to display in the form. Array key is the input `name` and each entry is usually an array of input options.

An entry can also be a single string or a non-associative array of strings, and if so they are displayed as strings of html within a `.form-group` element.

### model (optional)

[](#model-optional)

If supplied, inputs will be pre-filled with corresponding attribute values from this object.

### action (optional)

[](#action-optional)

Maps directly to the form's `action` attribute. If omitted the form will usually post back to the current page.

### method (optional)

[](#method-optional)

Maps directly to the form's `method` attribute. Defaults to `POST`, can be set to `GET`.

### role (optional)

[](#role-optional)

Maps directly to the form's `role` attribute. Defaults to `form`.

### form\_id (optional)

[](#form_id-optional)

Sets the form's `id` attribute. Defaults to a generated id if omitted.

### group\_form\_errors (optional)

[](#group_form_errors-optional)

Defaults to `false`, but if `true` all error-messages will be displayed together at the top of the form instead of next to their related inputs. This is useful for forms where validation-messages are not directly related to specific inputs, e.g. login forms.

Input options
-------------

[](#input-options)

### name

[](#name)

Name of the input, will be posted with the form. This option is pulled from the array key if the `bsb::form` template is used.

### type

[](#type)

Defaults to `text` if omitted. The implemented types are:

- text
- checkbox
- select
- multiselect
- password

In addition, most HTML5 input types work fine, e.g. `number`, `email`, etc. The multiselect types will automatically add brackets to the form input's name to access selected values as an array at the server side.

### label/html\_label

[](#labelhtml_label)

Displayed before the input and connected to it via element's id. Defaults to `name` if not supplied.

### help\_text/html\_help\_text

[](#help_texthtml_help_text)

This is displayed after the input and connected to it with `aria-describedby`.

### help\_block\_tag

[](#help_block_tag)

This can override the type of html element that contains the help text. If not set `span` is used around `help_text` and `div` around `html_help_text`.

### no\_label

[](#no_label)

Set this to `true` to not display any label for the form-group.

### group\_label

[](#group_label)

Set this to `true` on checkboxes to display the group-label instead of having the label within the input-tag.

### no\_group

[](#no_group)

Set to `true` to not have a `.form-group` class on the input's grouping div. Useful for keeping a list of checkboxes closer together.

### value

[](#value)

Can be used to specifically set the `value` attribute of the input. The value is usually automatically pulled from old input or from a model. The value defaults to 1 for checkboxes.

### selected\_values

[](#selected_values)

Can be used with selects and multiselects to specify the pre-selected value or an array of pre-selected values. This is usually automatically pulled from old input or from a model.

### checked

[](#checked)

Set to `true` on a checkbox to make it pre-selected. Otherwise the checked-status is pulled from old input or from a model.

### options/options\_html

[](#optionsoptions_html)

Can be used with selects and multiselects to specify the list of available options. `options_html` is used as raw output within the select tag. `options` can be an array of label strings with the corresponding values as keys. If no options are specified, the supplied `model` will be checked for a property called *inputname*\_options.

### input\_attributes

[](#input_attributes)

Array of extra html attributes (keys and values) to put on the input element. Boolean attributes (like `disabled`) can be set to `true` for the desired effect. If the `class` attribute is set here it's value is merged with any other classes that have been set automatically.

Optional package configuration
------------------------------

[](#optional-package-configuration)

The `bsb` prefix can be changed if you extend the service provider class in your app and set your desired `$package_reference_name` in there (if you do this, remember to reference your own service provider in your `config/app.php` instead of the one supplied by this package)

You may publish the blade templates to your project's `views/vendor` directory for editing and overriding the original templates:

> php artisan vendor:publish --provider="FewAgency\\TwbsBlade\\TwbsBladeServiceProvider"

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~227 days

Total

5

Last Release

3093d ago

Major Versions

v1.0 → v2.02015-08-04

### Community

Maintainers

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

---

Top Contributors

[![bjuppa](https://avatars.githubusercontent.com/u/5339269?v=4)](https://github.com/bjuppa "bjuppa (65 commits)")

---

Tags

laravelbladebootstraptwbs

### Embed Badge

![Health badge](/badges/fewagency-twbs-blade/health.svg)

```
[![Health](https://phpackages.com/badges/fewagency-twbs-blade/health.svg)](https://phpackages.com/packages/fewagency-twbs-blade)
```

###  Alternatives

[madbob/larastrap

Opinionated Bootstrap5 components for Laravel.

108.8k](/packages/madbob-larastrap)

PHPackages © 2026

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