Download the PHP package balfour/laravel-form-builder without Composer
On this page you can find all versions of the php package balfour/laravel-form-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download balfour/laravel-form-builder
More information about balfour/laravel-form-builder
Files in balfour/laravel-form-builder
Package laravel-form-builder
Short Description A library for building & rendering forms in Laravel
License MIT
Informations about the package laravel-form-builder
laravel-form-builder
A library for building & rendering forms in Laravel.
We originally developed this library for our internal systems which are based off of Bootstrap 4 and CoreUI. We've tried to not be too opinionated about markup; however the library does generate markup with Bootstrap 4 classes in mind.
If you're not using Bootstrap 4, or are using an older version, you'll need to add compatible CSS classes to handle the styling of components.
This library is in early release and is pending unit tests.
Table of Contents
- Installation
- Creating a Form
- Filling a Form
- Form Validation
- Controller Validation
- Form Request Validation
- Components
- Checkbox (Single)
- Checkboxes (Multiple)
- DateInput
- EmailInput
- FieldSet
- FileInput
- HiddenInput
- MobileNumberInput
- NumberInput
- PasswordInput
- PhoneNumberInput
- RadioButtonGroup
- RichTextEditor
- Row
- Select
- TextArea
- TextInput
- TimePicker
- ToggleSwitch
Installation
Creating a Form
You can either create your form on the fly by constructing a Form
, or you can create
a custom class such as CreateUserForm
which builds the components in the class constructor.
You can create the form object in your controller and pass it through to your view.
In your view, you can then call the render
method on the form.
Filling a Form
The $form->fill()
method can be used to set the default values for all form components.
This method can either take an array
or key => value pairs, or a model
.
As an example, here is an EditUserForm
which populates from an existing user model.
When we construct the form, we just need to pass in a user model and all components will be populated from the model.
Form Validation
The library will automagically generate validation rules for you based on the nested components
of the form. The $form->getValidationRules()
method can be called to generate the rules.
The validation of the actual form data is left up to you.
Controller Validation
Form Request Validation
Components
The following components are bundled into this package:
- Checkbox (Single)
- Checkboxes (Multiple)
- DateInput
- EmailInput
- FieldSet
- FileInput
- HiddenInput
- MobileNumberInput
- NumberInput
- PasswordInput
- PhoneNumberInput
- RadioButtonGroup
- RichTextEditor
- Row
- Select
- TextArea
- TextInput
- TimePicker
- ToggleSwitch
You can also create your own custom components by implementing ComponentInterface
, or
FormControlInterface
which extends ComponentInterface
.
Checkbox (single)
Checkboxes (multiple)
DateInput
EmailInput
FieldSet
FileInput
HiddenInput
MobileNumberInput
NumberInput
PasswordInput
PhoneNumberInput
RadioButtonGroup
RichTextEditor
Row
Select
TextArea
TextInput
TimePicker
ToggleSwitch
All versions of laravel-form-builder with dependencies
illuminate/database Version ^5.7|^6.0
illuminate/support Version ^5.7|^6.0
illuminate/validation Version ^5.7|^6.0
propaganistas/laravel-phone Version ^4.2