Download the PHP package bnbwebexpertise/laravel-bootstrap-form without Composer

On this page you can find all versions of the php package bnbwebexpertise/laravel-bootstrap-form. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-bootstrap-form

Bootstrap 4 forms for Laravel 5

This is a package for simply creating Bootstrap 4 styled form groups in Laravel 5. It extends the normal form builder to provide you with horizontal form groups completed with labels, error messages and appropriate class usage.

For Bootstrap 3, use version 1.x : composer require bnbwebexpertise/laravel-bootstrap-form:^1

Introduction

Simply use the BootstrapForm facade in the place of the Form facade when you want to generate a Bootstrap 4 form group.

And you'll get back the following:

Of course, if there are errors for that field it will even populate them.

Installation

First, require the package using Composer.

For Laravel 5.5 and newer the package is auto-loaded. For older versions, you must configure the providers as described below.

Add these service providers to your config/app.php file (don't add the HtmlServiceProvider if you already have it).

And finally add these to the aliases array (note: Form and Html must be listed before BootstrapForm):

Feel free to use a different alias for BootstrapForm if you'd prefer something shorter.

Configuration

There are a number of configuration options available for BootstrapForm. Run the following Artisan command to publish the configuration option to your config directory:

Horizontal form sizes

When using a horizontal form you can specify here the default sizes of the left and right columns. Note you can specify as many classes as you like for each column for improved mobile responsiveness, for example:

Display errors

By default this package will only display the first validation error for each field. If you'd instead like to list out all the validation errors for a field, simply set this configuration option to true.

Required fields

By default this package will append an asterisk * to the label of required fields. It will also add the required CSS class to the form group. You may override these values in the configuration file or by passing the values to the open method :

Default values

You can force default values by passing the values to the open method :

These values take precedence over the model values, but not the provided or the old/request ones.

Usage

When used in a blade template enclose the helper methods inside an unescaped block: {!! !!}

Warning : make sure to escape any character which comes from user input (from any possible source) while using raw ouput tags especially when using explicit HTML version of values.

Opening a form

BootstrapForm has improved the process of opening forms, both in terms of providing Bootstrap classes as well as managing models for model-based forms.

If a model is passed to the open method, it will be configured to use the update route with the PUT method. Otherwise it will point to the store method as a POST request. This way you can use the same opening tag for a form that handles creating and saving.

Form variations

There are a few helpers for opening the different kinds of Bootstrap forms. By default, open() will use the the form style that you have set in the configuration file. These helpers take the same input as the open() method.

If you want to change the columns for a form for a deviation from the settings in your configuration file, you can also set them through the $options array.

Text inputs

Here are the various methods for text inputs. Note that the method signatures are relatively close to those provided by the Laravel form builder but take a parameter for the form label.

Checkbox and radio button inputs

Checkboxes and radio buttons are a little bit different and generate different markup.

View the method signature for configuration options.

Same goes for radio inputs.

Multiple checkboxes and radio buttons

By simply passing an array of value/label pairs you can generate a group of checkboxes or radio buttons easily.

Submit button

Custom button

Closing the form

Labels

Hide Labels

You may hide an element's label by setting the the value to false.

Labels with HTML

To include HTML code inside a label:

Help Text

You may pass a help_text option to any field to have Bootstrap Help Text appended to the rendered form group.

Form group comment

displays a comment line with bootstrap help-block class :

Form group class

adds a class to the form-group element :

Static Fields

Display text as static field (replicate input layout) with optionnal default value (supports HTML)


All versions of laravel-bootstrap-form with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/config Version >=6.0
illuminate/session Version >=6.0
illuminate/support Version >=6.0
laravelcollective/html Version >=6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bnbwebexpertise/laravel-bootstrap-form contains the following files

Loading the files please wait ....