This package allows to you build forms in blade in a clean and easy way. It provides a @form
directive that you can use in Blade in order to render forms. The forms can be rendered in Bootstrap, Bulma or Tailwind.
You can install the package via composer:
composer require soarecostin/blade-form-components
A demo usage of this package can be seen at: https://bfc-demo.dev.soa.re/ (github repo)
The demo uses the following Blade template in order to render the form:
@form('open')
@form('input', ['name' => 'id', 'disabled' => true, 'value' => 1])
@form('input', ['name' => 'name', 'required' => true, 'placeholder' => 'John Doe'])
@form('password', ['name' => 'password', 'required' => true, 'help' => 'Minimum 6 characters'])
@form('email', ['name' => 'email', 'required' => true, 'placeholder' => '[email protected]'])
@form('input', ['name' => 'price', 'class' => 'is-rounded is-expanded', 'required' => true,
'addons' => $priceAddons,
])
@form('textarea', ['name' => 'message', 'rows' => 6, 'desc' => 'Let us know how we can help you below'])
@form('select', [
'name' => 'language',
'label' => 'Language',
'options' => [
'en' => 'English',
'fr' => 'French'
],
'nulloption' => 'Please select',
])
@form('checkbox', ['name' => 'terms', 'label' => 'I agree to the Terms and Conditions'])
@form('submit', ['name' => 'Submit', 'class' => 'is-warning'])
@form('close')
You can publish the configuration file, that contains all the available checks using:
php artisan vendor:publish --provider=SoareCostin\BladeFormComponents\BladeFormComponentsServiceProvider
This will publish a blade-form-components.php
file in your config folder.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.