Download the PHP package cartapia/form-builder without Composer
On this page you can find all versions of the php package cartapia/form-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package form-builder
Laravel 5 form builder
Form builder for Laravel 5 inspired by Symfony's form builder. With help of Laravels FormBuilder class creates forms that can be easy modified and reused. By default it supports Bootstrap 3.
Laravel 4
For Laravel 4 version check laravel4-form-builder.
Bootstrap 4 support
To use bootstrap 4 instead of bootstrap 3, install form-builder-bs4.
Upgrade to 1.6
If you upgraded to >1.6.*
from 1.5.*
or earlier, and having problems with form value binding, rename default_value
to value
.
More info in changelog.
Documentation
For detailed documentation refer to https://kristijanhusak.github.io/form-builder/.
Changelog
Changelog can be found here.
Installation
Using Composer
Or manually by modifying composer.json
file:
And run composer install
Then add Service provider to config/app.php
And Facade (also in config/app.php
)
Notice: This package will add laravelcollective/html
package and load aliases (Form, Html) if they do not exist in the IoC container.
Quick start
Creating form classes is easy. With a simple artisan command:
Form is created in path app/Forms/SongForm.php
with content:
If you want to instantiate empty form without any fields, just skip passing --fields
parameter:
Gives:
After that instantiate the class in the controller and pass it to view:
Alternative example:
If you want to store a model after a form submit considerating all fields are model properties:
You can only save properties you need:
Or you can update any model after form submit:
Create the routes
Print the form in view with form()
helper function:
Go to /songs/create
; above code will generate this html:
Or you can generate forms easier by using simple array
Contributing
Project follows PSR-2 standard and it's covered with PHPUnit tests. Pull requests should include tests and pass Travis CI build.
To run tests first install dependencies with composer install
.
After that tests can be run with vendor/bin/phpunit
All versions of form-builder with dependencies
cartapia/html Version ^5.6|^6|^7|^8|^9
illuminate/database Version ^5.6@dev|^6|^7|^8|^9
illuminate/validation Version ^5.6@dev|^6|^7|^8|^9