Download the PHP package galahad/bootforms without Composer
On this page you can find all versions of the php package galahad/bootforms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package 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
This package has been replaced by 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 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
This package forks abandoned Adam Wathan's repository 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
- Installation
- Using BootForms
- Basic Usage
- Customizing Elements
- Reduced Boilerplate
- Automatic Validation State
- Horizontal Forms
- Additional Tips
- Related Resources
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:
Using BootForms
Basic Usage
BootForms lets you create a label and form control and wrap it all in a form group in one call.
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
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.
For more information about what's possible, check out the documentation for the basic Forms package.
Reduced Boilerplate
Typical Bootstrap form boilerplate might look something like this:
BootForms makes a few decisions for you and allows you to pare it down a bit more:
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:
And reduces it to this:
...with the has-error
class being added automatically if there is an error in the session.
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:
Additional Tips
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
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
BootForms makes it easy to bind an object to a form to provide default values. Read more about it here.
All versions of bootforms with dependencies
galahad/forms Version ^1.6|dev-master
illuminate/support Version 5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0|^10.0