dev-master
9999999-devA form wrapper for laravel, implemented with bootstrap fields
MIT
The Requires
by Ahimbisibwe Roland
Wallogit.com
2017 © Pedro Peláez
A form wrapper for laravel, implemented with bootstrap fields
Laravel-Forms is a laravel library that generates front end forms with fields, errors ,crsf_tokens,actions, method_fields using laravel's expressive syntax, (*1)
Laravel-Forms is heavily inspired by Laravels Migrations Schemer Builder (Illuminate\Database\Schema\Builder), (*2)
Laravel-Forms requires laravel >= 5.5., (*3)
composer require lawma/larevel-forms
The great Laravel auto discovery package will register for you both the service provider and the Facade after installation., (*4)
Use Form facade in your blade views to generate the form fields, (*5)
{{
Form::fields(function($form){
$form->textField()->label("Clients Name")->name("name")
$form->numberField()->label("AccountBalance")->name("accountBalance")->step(0.5);
$form->button()->text('Create Client')->icon('fa fa-user');
})->action(route("clients.store"))->method("POST")
}}
$form->textField() $form->numberField()$form->emailField() $form->numberField()$form->passwordField()
Every field extends the base field Lawma\Forms\Field and has access to setters like the field name, field type.You can set the model on a form, this can be useful when editing records
$form->model($user)
You can as well as set the model on a specific field in rare circumstances where the form is using multiple fields
$form->textField()->model($user)->name('name'), (*6)
Out of the box , Laravel-Forms uses bootstrap 4 form fields, but you can publish them and customize them in which ever you want, (*7)
Laravel-forms is released under the MIT Licence, (*8)
A form wrapper for laravel, implemented with bootstrap fields
MIT