bgaze/bootstrap-form

Bootstrap 4 forms builder for Laravel 5.8+

v1.0.8 2020-05-14 04:42 UTC

This package is auto-updated.

Last update: 2020-07-31 00:28:45 UTC


README

GitHub license Maintenance GitHub release (latest by date) GitHub stars Packagist

intro.png

This package uses in background Laravel Collective HTML to simplify Bootstrap 4 forms creation into Laravel applications.

Model form binding and automatic error display are supported, as well as most of Bootstrap forms features : form layouts, custom fields, input groups, ...

Any contribution or feedback is highly welcomed, please feel free to create a pull request or submit a new issue.

Documentation

Full documentation and examples are available at https://packages.bgaze.fr/bootstrap-form

Quick start

Simply install the package using Composer:

composer require bgaze/bootstrap-form

There are a various configuration options available, publish the configuration file to customize them:

php artisan vendor:publish --provider="Bgaze\BootstrapForm\BootstrapFormServiceProvider"

The BF facade provides many methods to create forms and inputs:

echo BF::open(['url' => '/my/url', 'novalidate' => true])
echo BF::text('login')
echo BF::email('email')
echo BF::checkbox('remember_me', null, 1, null, ['switch' => true, 'inline' => true])
echo BF::submit('Login')
echo BF::close()

Most of them have a Blade directive alias to ease form creation from Blade templates:

@open(['url' => '/my/url', 'novalidate' => true])
    @text('login')
    @email('email')
    @checkbox('remember_me', null, 1, null, ['switch' => true, 'inline' => true])
    @submit('Login')
@close