PHPackages                             christhompsontldr/collective-input - 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. christhompsontldr/collective-input

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

christhompsontldr/collective-input
==================================

A Laravel Collective form component for building Bootstrap 4 friendly form elements.

v3.0.60(3y ago)64.2k3MITPHP

Since Nov 9Pushed 3y ago4 watchersCompare

[ Source](https://github.com/ChrisThompsonTLDR/collective-input)[ Packagist](https://packagist.org/packages/christhompsontldr/collective-input)[ RSS](/packages/christhompsontldr-collective-input/feed)WikiDiscussions 3.x Synced today

READMEChangelog (10)Dependencies (1)Versions (93)Used By (0)

This package extends [Laravel Collective](https://github.com/LaravelCollective/html) and adds a new method to help build a [Bootstrap 4 inputs](https://getbootstrap.com/docs/4.5/components/forms/).

### Laravel 5+

[](#laravel-5)

```
{{ Form::bs('first_name') }}

```

### Laravel 7

[](#laravel-7)

Laravel's new [Component markup](https://laravel.com/docs/7.x/blade#components) is supported.

```

```

### Generated DOM

[](#generated-dom)

```

    First Name

```

Usage
=====

[](#usage)

Attributes and Options
----------------------

[](#attributes-and-options)

Configuration of the HTML inputs can be accomplished with either attributes or via an "options" array.

### Attributes

[](#attributes)

#### Mixed

[](#mixed)

The following are attributes can be boolean or a string: `label` and `placeholder`

If `false` is set as th value, the `label` or `placeholder` will be disabled/not displayed.

```

```

#### Boolean

[](#boolean)

The following are attributes can be boolean: `checked`, `placeholder`, `selected` and `required`

```

```

The `placeholder` options, when used as a boolean, will attempt to intelligently create a placeholder.

### Options

[](#options)

Or if you find it easier to use a large array of options, that works as well

```

```

### Shorthand Options

[](#shorthand-options)

A few options can be passed as a value to make setting them easier. These include: `required`, `livewire`, `checked`, `wireLazy`, `wireDefer`

The following generate the same DOM:

```

{{ Form::bs('first_name', 'text', ['required']) }}

{{ Form::bs('first_name', 'text', ['required' => true]) }}

```

Dot Syntax
----------

[](#dot-syntax)

Dot syntax will be automatically converted as needed.

```

```

Both will create the same DOM.

```

    First Name

```

Field Types
===========

[](#field-types)

All field types are supported, not just the following list.

Text
----

[](#text)

Text will be used by default if the `type` is not specified.

Email
-----

[](#email)

If the `name` attribute is `email`, the email input type will automatically be used.

```

```

generates

```

    Email

```

Select
------

[](#select)

Notice in the following example that `type` is not set. It will automatically be determined because `select_options` is set.

```

```

WYSIWYG Editor
--------------

[](#wysiwyg-editor)

If the type is set to `html`, the input will be converted to a [Summernote editor](https://github.com/summernote/summernote).

```

```

The `height` option needs to be entered as an integer.

Markdown Editor
---------------

[](#markdown-editor)

If the type is set to `markdown`, the input will be converted to a [SimpleMDE editor](https://github.com/sparksuite/simplemde-markdown-editor).

```

```

File
----

[](#file)

If the type is `file`, the input will be converted to a [bs-custom-file-input](https://github.com/Johann-S/bs-custom-file-input).

The generated DOM will be [Bootstrap's markup](https://getbootstrap.com/docs/4.5/components/forms/#file-browser).

Datetime
--------

[](#datetime)

The datetime picker utilizes [tempusdominus/bootstrap-4](https://github.com/tempusdominus/bootstrap-4) and assumes that you have FontAwesome 5 loaded.

Form Group
----------

[](#form-group)

### Remove

[](#remove)

It is possible to remove the wrapper div.

```

```

### Class

[](#class)

Add a class to the wrapper div. Make sure to include Bootstrap's default.

```

```

Labels
------

[](#labels)

### Automatic

[](#automatic)

```

...

    Role

```

or

```

...

    User First Name

```

You can specify the label if you want.

```

...

    Pick a role

```

This package will auto generate a human readable `` or you can set your own.

### Remove

[](#remove-1)

It is possible to remove the label.

```

```

### Class

[](#class-1)

Add a class to the label.

```

```

Helper
------

[](#helper)

Utilize the `helper` attribute to add a input help block below the input.

```

```

Optional Second Parameter
-------------------------

[](#optional-second-parameter)

If using the `Form` class, the second parameter is optional.

```
{{ Form::bs('first_name', ['required']) }}

{{ Form::bs('first_name', 'text', ['required']) }}

```

Dusk
====

[](#dusk)

[Dusk selectors](https://laravel.com/docs/7.x/dusk#dusk-selectors) are enabled by default in any environment other than `production`. This can by changed in `config/form.php`

Slots
=====

[](#slots)

Because every parameter can also be a slot, if you have a more complex need for passing DOM into part of this component, [Blade slots](https://laravel.com/docs/master/blade#slots) can be used.

```

        I agree to the cancellation terms

```

This package provides two [Blade slots](https://laravel.com/docs/master/blade#slots) for injecting DOM before and after the input.

Before
------

[](#before)

```

        Please enter your full first name.

```

will generate

```

    Please enter your full first name.
    First Name

```

After
-----

[](#after)

```

        Please enter your full last name.

```

will generate

```

    Last Name

    Please enter your full last name.

```

Assets
======

[](#assets)

If you use `markdown`, `html`, `file` or `datetime` types, you will need to include the following stacks in your layouts.

```
    ...
    @stack('after-styles')

    ...
    @stack('after-scripts')

```

The names of these slots can be configured as part of this package. Because of the way Laravel Blade/View caching works, you will need to run `php artisan view:clear` if you change these config parameters.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 96.6% 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 ~14 days

Recently: every ~32 days

Total

90

Last Release

1441d ago

Major Versions

v1.0.10 → v2.02019-09-09

v1.0.13 → v2.0.12019-12-18

v1.x-dev → v2.0.22019-12-18

2.x-dev → v3.0.02020-05-26

### Community

Maintainers

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

---

Top Contributors

[![ChrisThompsonTLDR](https://avatars.githubusercontent.com/u/348801?v=4)](https://github.com/ChrisThompsonTLDR "ChrisThompsonTLDR (84 commits)")[![jameswagoner](https://avatars.githubusercontent.com/u/3052854?v=4)](https://github.com/jameswagoner "jameswagoner (2 commits)")[![adriangonzales](https://avatars.githubusercontent.com/u/486071?v=4)](https://github.com/adriangonzales "adriangonzales (1 commits)")

---

Tags

laravelbootstrapcollectiveForms

### Embed Badge

![Health badge](/badges/christhompsontldr-collective-input/health.svg)

```
[![Health](https://phpackages.com/badges/christhompsontldr-collective-input/health.svg)](https://phpackages.com/packages/christhompsontldr-collective-input)
```

###  Alternatives

[metalogico/laravel-formello

A Laravel package for generating Bootstrap 5 and Tailwind CSS 4 forms based on models

1012.2k](/packages/metalogico-laravel-formello)[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)[unclecheese/bootstrap-forms

Allows you to create forms in SilverStripe that are compatible with Twitter Bootstrap.

5539.4k](/packages/unclecheese-bootstrap-forms)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

252.7k](/packages/cornford-bootstrapper)

PHPackages © 2026

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